hasJapaneseNumerals() public static méthode

Determines whether the given string contains Japanese numerals.
public static hasJapaneseNumerals ( string $str ) : boolean
$str string The string to inspect.
Résultat boolean TRUE if it contains Japanese numerals, otherwise FALSE.
 private function getType($str)
 {
     $type = 'O';
     if (Analyzer::hasJapaneseNumerals($str)) {
         $type = 'M';
     } elseif (Analyzer::hasKanji($str, true)) {
         $type = 'H';
     } elseif (Analyzer::hasHiragana($str)) {
         $type = 'I';
     } elseif (Analyzer::hasKatakana($str)) {
         $type = 'K';
     } elseif (Analyzer::hasLatinLetters($str)) {
         $type = 'A';
     } elseif (Analyzer::hasWesternNumerals($str)) {
         $type = 'N';
     }
     return $type;
 }
Exemple #2
0
 public function testHasNotJapaneseNumeral()
 {
     $result = Analyzer::hasJapaneseNumerals($this->hiraganaCharacters);
     $this->assertEquals(FALSE, $result);
 }