誰かが数百語の長さのテキストを取り、キーワードの配列を生成する利用可能なPHP関数を知っていますか?つまり最も重要な、頻繁に発生するユニークな用語そのような機能は存在しない(それがなかった場合は魔法のだろう)が、何かを始めるために、あなたは次のことを行うことができ フィリップKeywords from string
2
A
答えて
7
ありがとう:
- Splitスペースのテキスト、 が生産単語の配列。
- stop-wordsと 不要な句読点と記号(おそらくregular expressions -
preg_replace
を参照)を削除します。 - は(
$words[0]
ので最も頻繁occuring単語、すなわち、最初のオフセットである)、残りのアレイ内 各単語、 の出現箇所の数をカウントし、周波数 のためにそれを並べ替えます。 - 重複を削除するためにarray_uniqueを使用すると、 出現頻度順の のユニークキーワードが作成されます。
0
このような何かがトリックを行う場合があります。また
$thestring = 'the most important, frequently occuring unique terms?';
$arrayofwords = explode(" ", $thestring);
echo print_r($arrayofwords);
空白の代替カンマ「」かもしれないので、あなたはクリーンなキーワードを取得します。
$thestring = 'the most important, frequently occuring unique terms?';
$cleaned_string = str_replace(",", "", "$thestring");
$arrayofwords = explode(" ", $cleaned_string);
echo print_r($arrayofwords);
関連する問題
- 1. NSDate from string
- 2. date from string YYMMDDHHMMSS
- 3. Scala FiniteDuration from String
- 4. double from fraction string iPhone
- 5. FilterBy from Start of String
- 6. string(49) "select * from php mysql error
- 7. C#抽出値from string
- 8. Elisp - APIからの応答のjson-read-from-string
- 9. C#/ LINQでQuery-Keywordsを拡張することはできますか?
- 10. rails from html from rack
- 11. forward from log4net from NLog
- 12. iPhone - presentModalViewController from right from
- 13. JSON GSON from http
- 14. identity from sql insert from jdbctemplate
- 15. Json from data.frame from data.frame R
- 16. Amplitude from AudioRecord
- 17. Linux exec from C++
- 18. android startActivity from JavascriptInterface
- 19. linq - from in select
- 20. JSON from ASMXサービス
- 21. from compare.sort()to compareTo()
- 22. VBA Integer from Cell
- 23. Android - Intercept Link from Webview
- 24. update listview from viewmodel
- 25. url from Parse toボタンアクション
- 26. jsonオブジェクトfrom PHP
- 27. INSERT INTO table_a select * from table_b from doctrine2
- 28. Observable Observable from Observable from Angular 2 in Typescript
- 29. FROM句
- 30. Microsoft WinForm ReportViewer from List
あなたは私にそれを打つ。 –