全文(ファイル)からCOUNT(出現頻度)のWORDSを含む辞書がすでにあります。C#:リストにある文字列(テキスト)の辞書のキー(単語)の出現をカウントする
次のステップでは、Textの各文にある各WORDの出現を確認します。
単語の出現頻度が高い文章を保存します。例えば
:チェック
List<string> list = new List<string>();
list.Add("This this is a string.");
list.Add("String words accurences needs to be checked.");
list.Add("how many times do this string text conatin words?");
list.Add("how how how word words words");
list.Add("This this This this");
Dictionary<string, int> dict = new Dictionary<string, int>(StringComparer.CurrentCultureIgnoreCase);
dict.Add("this", 7);
dict.Add("how", 4);
dict.Add("string", 2);
dict.Add("words", 2);
dict.Add("occurences", 1);
dict.Add("checked", 1);
コード「4は、どのように、」第二と第三のリストの文字列と第三列に来ることの高い発生を持っています。 3番目の "文"文字列を出現頻度の高い3つのintを単語HOWで出力する必要があります。 など..辞書内の他の単語を確認してください。
辞書は次のようになります。 {文、単語、オカレンス} オカレンスは高いか同じカウントである必要があります。
次のタスクは、各センテンスの語長をカウントすることです。
...そして質問は? –
http://idownvotedbecau.se/noattempt/ – pmcilreavy
質問は、どのように辞書に存在する単語の出現数が最も多い文章を得ることができるかです。 確認後に辞書から単語を削除する。 辞書にcountを含む文章を保存します。 – Nab