100000 通のメール本文があり、そのうちの 2000 通には、「怠惰な犬を飛び越える素早い茶色のキツネ」や「lorem ipsum dolor sit amet」などの任意の共通文字列が含まれているとします。これらのフレーズを「マイニング」するには、どのような手法を使用できますか? 単語や短いフレーズのマイニングには興味がありません。また、すべてのメールに含まれていることがわかっているフレーズを除外する必要があります。
例:
string mailbody1 = "Welcome to the world of tomorrow! This is the first mail body. Lorem ipsum dolor sit AMET. Have a nice day dude. Cya!";
string mailbody2 = "Welcome to the world of yesterday! Lorem ipsum dolor sit amet Please note this is the body of the second mail. Have a nice day.";
string mailbody3 = "A completely different body.";
string[] mailbodies = new[] {mailbody1, mailbody2, mailbody3};
string[] ignoredPhrases = new[] {"Welcome to the world of"};
string[] results = DiscoverPhrases(mailbodies, ignoredPhrases);
この例では、DiscoverPhrases 関数が「lorem ipsum dolor sit amet」と「have a nice day」を返すようにします。関数が短い「ノイズ」フレーズも返すかどうかはそれほど重要ではありませんが、可能であれば、プロセスでこれらを排除するとよいでしょう。
編集: 例に mailbody3 を含めるのを忘れていました。