Permalink
Browse files

small fix; normalize strings

  • Loading branch information...
moritz committed Oct 21, 2010
1 parent 3501ea8 commit 85f1f2a969e514f223595e9d4f49a8966fbc2445
Showing with 7 additions and 2 deletions.
  1. +6 −1 coach.pl
  2. +1 −1 data/words-no-de
View
@@ -19,7 +19,11 @@
unless @words {
die "No valid lines in data file found";
+}
+sub normalize($x) {
+ $x.trans([<å ø æ Å Ø Æ ä ö ü Ä Ö Ü>]
+ => [<aa oe ae Aa Oe Ae ae oe ue Ae Oe Ue>]);
}
loop {
@@ -28,11 +32,12 @@
my $response = prompt("(de) $sl = (no) ");
if $response eq $fl {
say ":-)";
+ } elsif normalize($response) eq normalize($fl) {
+ say ":-/ $fl";
} else {
say ":-( $fl";
}
-
}
View
@@ -4,7 +4,7 @@ han - er
hun - sie (singular)
det - es
ve - wir
-dere - ihr (singular)
+dere - euch (singular)
de - sie (plural)
og - und
å bo - wohnen

0 comments on commit 85f1f2a

Please sign in to comment.