Method | Description | |
---|---|---|
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 |
public static countHiragana ( string $str ) : integer | ||
$str | string | The input string. |
return | integer | Returns the number of hiragana. |
public static countKatakana ( string $str ) : integer | ||
$str | string | The input string. |
return | integer | Returns the number of katakana |
public static hasHiragana ( string $str ) : boolean | ||
$str | string | The string to inspect. |
return | boolean | TRUE if it contains at least one hiragana, otherwise FALSE. |
public static hasJapaneseLetters ( string $str ) : boolean | ||
$str | string | The string to inspect. |
return | boolean | TRUE if it contains either kanji, hiragana or katakana, otherwise FALSE. |
public static hasJapaneseNumerals ( string $str ) : boolean | ||
$str | string | The string to inspect. |
return | boolean | TRUE if it contains Japanese numerals, otherwise FALSE. |
public static hasJapanesePunctuationMarks ( string $str ) : boolean | ||
$str | string | The string to inspect. |
return | boolean | TRUE if it contains Japanese punctuation marks, otherwise FALSE. |
public static hasJapaneseWritings ( string $str ) : boolean | ||
$str | string | The string to inspect. |
return | boolean | TRUE if it contains either kanji, hiragana, katakana or punctuation marks, otherwise FALSE. |
public static hasKatakana ( string $str ) : boolean | ||
$str | string | The string to inspect. |
return | boolean | TRUE if it contains at least one katakana, otherwise FALSE. |
public static hasLatinLetters ( string $str ) : boolean | ||
$str | string | The string to inspect. |
return | boolean | TRUE if it contains latin letters, otherwise FALSE. |
public static hasWesternNumerals ( string $str ) : boolean | ||
$str | string | The string to inspect. |
return | boolean | TRUE if it contains Western numerals, otherwise FALSE. |
public static inspect ( string $str ) : array | ||
$str | string | The string to be inspected. |
return | 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. |