注: ここでは、Java で単語カウント アルゴリズムを探しているわけではありません。str_word_count
PHPソースコードのどこを見つけるか尋ねています。
PHP関数をJavaメソッドとして再作成(可能な場合は1行ずつ)することを検討しています:str_word_count
public class PhpWordCounter {
public int strWordCount(String str) {
// The exact algorithm used in PHP's str_word_count here...
// The str_word_count method takes an optional parameter
// "format", which, if 0, returns the number of words.
// This is the portion of the routine that I will actually
// be mimicking.
}
}
PHP 5.3.23 のソース コード (tarball) をダウンロードして解凍しました。私は grep しましstr_word_count
たが、何も見つかりませんでした。そのため、検索するファイルは言うまでもなく、何を探すべきかさえわかりません。誰かアイデアはありますか? 前もって感謝します!