Я уже разработал это решение для себя с PHP, но мне любопытно, как это можно сделать по-другому - даже лучше. Мне в первую очередь интересуются два языка: PHP и Javascript, но мне было бы интересно узнать, как быстро это может быть сделано на любом другом важном языке сегодня (в основном, на С#, Java и т.д.).
- Возвращать только слова с вступлением больше X
- Возвращает только слова длиной более Y
- Игнорировать общие термины типа "и, есть, и т.д."
- Не снимайте пунктуацию перед обработкой (т.е. "Джон" становится "Джоном" )
- Возвращает результаты в коллекции/массиве
Дополнительный кредит
- Сохраняйте цитированные выражения вместе (т.е. "Они были" слишком хороши, чтобы быть правдой ", видимо" )
Где" слишком хорошо, чтобы быть правдой" было бы фактическое утверждение
Экстра-дополнительный кредит
- Может ли ваш script определять слова, которые должны храниться вместе, исходя из их частоты нахождения вместе? Это делается, не зная слов заранее. Пример:
* "Фруктовая муха - отличная вещь, когда дело доходит до медицинских исследований. В прошлом было сделано много исследований о фруктовой мухе и привело к многочисленным прорывам. В будущем плодовая муха по-прежнему будет но наши методы могут измениться". *
Ясно, что слово здесь - "плодовая муха", которое легко найти. Может ли этот поиск найти? script?
Исходный текст: http://sampsonresume.com/labs/c.txt
Формат ответа
- Было бы здорово увидеть результаты вашего кода, вывод, в дополнение к тому, как долго длилась операция.