Index: branches/nikola/phase3/languages/LanguageConverter.php |
— | — | @@ -780,8 +780,9 @@ |
781 | 781 | * @return bool true if $text appears to be written in $variant, false if not |
782 | 782 | * |
783 | 783 | * @author Nikola Smolenski <smolensk@eunet.yu> |
| 784 | + * @since 1.17 |
784 | 785 | */ |
785 | | - function guessVariant($text, $variant) { |
| 786 | + public function guessVariant($text, $variant) { |
786 | 787 | return false; |
787 | 788 | } |
788 | 789 | |
Index: branches/nikola/phase3/languages/classes/LanguageSr.php |
— | — | @@ -153,10 +153,11 @@ |
154 | 154 | * Guess if a text is written in Cyrillic or Latin. |
155 | 155 | * |
156 | 156 | * @author Nikola Smolenski <smolensk@eunet.rs> |
| 157 | + * @since 1.17 |
157 | 158 | */ |
158 | | - function guessVariant( $text, $variant ) { |
159 | | - $numCyrillic = preg_match_all("/(ш|ђ|ч|ћ|ж|Ш|Ђ|Ч|Ћ|Ж)/", $text, $dummy); |
160 | | - $numLatin = preg_match_all("/(š|đ|č|ć|ž|Š|Đ|Č|Ć|Ž)/", $text, $dummy); |
| 159 | + public function guessVariant( $text, $variant ) { |
| 160 | + $numCyrillic = preg_match_all("/[шђчћжШЂЧЋЖ]/u", $text, $dummy); |
| 161 | + $numLatin = preg_match_all("/[šđč枊ĐČĆŽ]/u", $text, $dummy); |
161 | 162 | |
162 | 163 | if( $variant == 'sr-ec' ) { |
163 | 164 | return $numCyrillic > $numLatin; |