PHP 클래스 JpnForPhp\Analyzer\Analyzer

저자: Matthieu Bilbille
파일 보기 프로젝트 열기: mbilbille/jpnforphp 1 사용 예제들

공개 메소드들

메소드 설명
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