Author: Matthieu Bilbille (@mbibille)
Exemple #1
0
 /**
  * Override transliterate().
  *
  * @see TransliterationSystem
  */
 public function transliterate($str, $stripwhitespace = self::STRIP_WHITESPACE_NONE)
 {
     $str = parent::transliterate($str);
     // Strip whitespace(s) here
     switch ($stripwhitespace) {
         case self::STRIP_WHITESPACE_AUTO:
             if (Helper::countSubString($str, ' ') > self::STRIP_WHITESPACE_AUTO_NB_SPACES) {
                 break;
             }
         case self::STRIP_WHITESPACE_ALL:
             $str = preg_replace('/\\s/u', '', $str);
             break;
     }
     return $str;
 }
Exemple #2
0
 /**
  * Kana's constructor
  */
 public function __construct($system = '')
 {
     $file = __DIR__ . DIRECTORY_SEPARATOR . 'Kana' . DIRECTORY_SEPARATOR . ($system ? $system : 'hiragana') . '.yaml';
     parent::__construct($file);
 }