PHP Класс JpnForPhp\Analyzer\Analyzer

Автор: Matthieu Bilbille
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
countHiragana ( string $str ) : integer Count number of hiragana within the specified string.
countKanji ( string $str, boolean $extended = false ) : integer Count number of kanji within the specified string.
countKatakana ( string $str ) : integer Count number of katakana within the specified string. Chōonpu (http://en.wikipedia.org/wiki/Chōonpu) is considered as Katakana here.
hasHiragana ( string $str ) : boolean Determines whether the given string contains hiragana characters.
hasJapaneseLetters ( string $str ) : boolean Determines whether the given string contains Japanese letters (kanji, hiragana or katakana).
hasJapaneseNumerals ( string $str ) : boolean Determines whether the given string contains Japanese numerals.
hasJapanesePunctuationMarks ( string $str ) : boolean Determines whether the given string contains Japanese punctuation marks.
hasJapaneseWritings ( string $str ) : boolean Determines whether the given string contains Japanese writings (kanji, hiragana, katakana or punctuation marks).
hasKana ( string $str ) : boolean Determines whether the given string contains kana (hiragana or katakana).
hasKanji ( string $str, boolean $extended = false ) : boolean Determines whether the given string contains kanji characters.
hasKatakana ( string $str ) : boolean Determines whether the given string contains katakana characters.
hasLatinLetters ( string $str ) : boolean Determines whether the given string contains latin letters
hasWesternNumerals ( string $str ) : boolean Determines whether the given string contains Western numerals.
inspect ( string $str ) : array Inspects a given string and returns useful details about it.
length ( string $str ) : integer Get string length.
segment ( string $str ) : array Segments the given string to its various part of speech components

Описание методов

countHiragana() публичный статический Метод

Count number of hiragana within the specified string.
public static countHiragana ( string $str ) : integer
$str string The input string.
Результат integer Returns the number of hiragana.

countKanji() публичный статический Метод

Count number of kanji within the specified string.
public static countKanji ( string $str, boolean $extended = false ) : integer
$str string The input string.
$extended boolean Determines whether to use the extended kanji set
Результат integer Returns the number of kanji.

countKatakana() публичный статический Метод

Count number of katakana within the specified string. Chōonpu (http://en.wikipedia.org/wiki/Chōonpu) is considered as Katakana here.
public static countKatakana ( string $str ) : integer
$str string The input string.
Результат integer Returns the number of katakana

hasHiragana() публичный статический Метод

Determines whether the given string contains hiragana characters.
public static hasHiragana ( string $str ) : boolean
$str string The string to inspect.
Результат boolean TRUE if it contains at least one hiragana, otherwise FALSE.

hasJapaneseLetters() публичный статический Метод

Determines whether the given string contains Japanese letters (kanji, hiragana or katakana).
См. также: hasKanji()
См. также: hasHiragana()
См. также: hasKatakana()
public static hasJapaneseLetters ( string $str ) : boolean
$str string The string to inspect.
Результат boolean TRUE if it contains either kanji, hiragana or katakana, otherwise FALSE.

hasJapaneseNumerals() публичный статический Метод

Determines whether the given string contains Japanese numerals.
public static hasJapaneseNumerals ( string $str ) : boolean
$str string The string to inspect.
Результат boolean TRUE if it contains Japanese numerals, otherwise FALSE.

hasJapanesePunctuationMarks() публичный статический Метод

Determines whether the given string contains Japanese punctuation marks.
public static hasJapanesePunctuationMarks ( string $str ) : boolean
$str string The string to inspect.
Результат boolean TRUE if it contains Japanese punctuation marks, otherwise FALSE.

hasJapaneseWritings() публичный статический Метод

Determines whether the given string contains Japanese writings (kanji, hiragana, katakana or punctuation marks).
См. также: hasKanji()
См. также: hasHiragana()
См. также: hasKatakana()
public static hasJapaneseWritings ( string $str ) : boolean
$str string The string to inspect.
Результат boolean TRUE if it contains either kanji, hiragana, katakana or punctuation marks, otherwise FALSE.

hasKana() публичный статический Метод

Determines whether the given string contains kana (hiragana or katakana).
См. также: hasHiragana()
См. также: hasKatakana()
public static hasKana ( string $str ) : boolean
$str string The string to inspect.
Результат boolean TRUE if it contains either hiragana or katakana, otherwise FALSE.

hasKanji() публичный статический Метод

Determines whether the given string contains kanji characters.
public static hasKanji ( string $str, boolean $extended = false ) : boolean
$str string The string to inspect.
$extended boolean Determines whether to use the extended kanji set
Результат boolean TRUE if it contains at least one kanji, otherwise FALSE.

hasKatakana() публичный статический Метод

Determines whether the given string contains katakana characters.
public static hasKatakana ( string $str ) : boolean
$str string The string to inspect.
Результат boolean TRUE if it contains at least one katakana, otherwise FALSE.

hasLatinLetters() публичный статический Метод

Determines whether the given string contains latin letters
public static hasLatinLetters ( string $str ) : boolean
$str string The string to inspect.
Результат boolean TRUE if it contains latin letters, otherwise FALSE.

hasWesternNumerals() публичный статический Метод

Determines whether the given string contains Western numerals.
public static hasWesternNumerals ( string $str ) : boolean
$str string The string to inspect.
Результат boolean TRUE if it contains Western numerals, otherwise FALSE.

inspect() публичный статический Метод

Inspects a given string and returns useful details about it.
См. также: length()
См. также: countKanji()
См. также: countHiragana()
См. также: countKatakana()
public static inspect ( string $str ) : array
$str string The string to be inspected.
Результат array An associative array containing the following items: - "length" : string length. - "kanji" : number of kanji within this string. - "hiragana" : number of hiragana within this string. - "katakana" : number of katakana within this string.

length() публичный статический Метод

Get string length.
См. также: mb_strlen()
public static length ( string $str ) : integer
$str string The string being measured for length.
Результат integer Returns the number of characters in the input string. A multi-byte character is counted as 1.

segment() публичный статический Метод

Segments the given string to its various part of speech components
public static segment ( string $str ) : array
$str string The string to segment
Результат array Segments parts of the given string