Unified
Split
Showing
with
16 additions
and 4 deletions.
- +16 −4 engines/prince/convert-ru.pl
| @@ -13,9 +13,9 @@ | ||
|
|
||
| my @english = (' a ', ' is ', ' i ', ' and ', ' be ', 'can', ' me', 'you', 'ack', 'that', 'then', 'yes', 'um', 'chi', 'year', 'mm', 'no', 'da', 'on', | ||
| 'bla', 'lik', 'ha', 'but', 'ma', 'wa', 'yeah', 'taste', 'str', 'grr', 'pff', 'air', 'lord', ' he, ', 'get', 'yuck', 'oo', 'blur', 'see', | ||
| 'puah', 'lo', 'go', 'cur', 'hop', 'super', 'doing', 'well', 'real', 'sure', 'final', 'all', 'illeg'); | ||
| 'puah', 'lo', 'go', 'cur', 'hop', 'super', 'doing', 'well', 'real', 'sure', 'final', 'all', 'illeg', 'done', 'empt'); | ||
|
|
||
| while (<>) { | ||
| while (<STDIN>) { | ||
| $line++; | ||
| my $str = $_; | ||
| my $lstr = lc $str; | ||
| @@ -25,7 +25,7 @@ | ||
| next; | ||
| } | ||
|
|
||
| if ($line == 4) { | ||
| if ($line >= 4 and not defined $lang) { | ||
| if (/Bpdbyz/) { | ||
| $lang = 'ru'; | ||
| } elsif (/Excuse/) { | ||
| @@ -35,14 +35,20 @@ | ||
| } elsif (/Przeppp/) { | ||
| $lang = 'pl'; | ||
| } else { | ||
| die "Unknown lanugage"; | ||
| if ($#ARGV == 0) { | ||
| $lang = $ARGV[0]; | ||
| } else { | ||
| die "Unknown lanugage"; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| if ($lang eq 'en') { | ||
| # Heuristics to detect Russian | ||
| my $eng = 0; | ||
|
|
||
| s/\x0d\|/\|/; # There is one instance of a stray ^M | ||
|
|
||
| for my $k (@english) { | ||
| if (index($lstr, $k) != -1) { | ||
| print; | ||
| @@ -69,4 +75,10 @@ | ||
| tr /QWERTYUIOPASDFGHJKLZXCVBNM\x82\x7f\x83\x81\x84/ЙЦУКЕНГШЩЗФЫВАПРОЛДЯЧСМИТЬЭХБЖЮ/; | ||
| print; | ||
| } | ||
|
|
||
| if ($lang eq 'pl') { | ||
| tr /\x9c\xea\xbf\xb3\x9f\xe6\xf1\xf3\xb9\xaf\x8c\xa3\xd1\xc6\xca/śężłźćń󹯌ŁŃĆĘ/; | ||
|
|
||
| print; | ||
| } | ||
| } | ||