hasKatakana() public static method

Determines whether the given string contains katakana characters.
public static hasKatakana ( string $str ) : boolean
$str string The string to inspect.
return boolean TRUE if it contains at least one katakana, otherwise FALSE.
Beispiel #1
0
 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;
 }
Beispiel #2
0
 public function testHasNoKatakana()
 {
     $result = Analyzer::hasKatakana($this->hiraganaCharacters);
     $this->assertEquals(FALSE, $result);
 }