Permalink
Browse files

Make sure acchi kanafies properly

  • Loading branch information...
1 parent 73b7e7d commit 3aeed013cc572043217b5b8fadcd8e637e7df384 Kim Ahlström committed Mar 23, 2010
Showing with 5 additions and 3 deletions.
  1. +1 −1 lib/DenshiJisho/Lingua.pm
  2. +4 −2 t/04denshijisho_lingua.t
@@ -125,7 +125,7 @@ sub romaji_to_kana {
$mora = $ROMAJI_TO_KANA->{$for_conversion};
}
elsif ( $for_conversion eq 'tch'
- || ( $length == 2 && $for_conversion =~ /([kgsztdnbpmyrlw])\1/ )
+ || ( $length == 2 && $for_conversion =~ /([kgsztdnbpmyrlwc])\1/ )
) {
# tch and double-consonants for small tsu
$mora = $H_SMALL_TSU;
View
@@ -1,7 +1,7 @@
use strict;
use warnings;
use utf8;
-use Test::More tests => 37;
+use Test::More tests => 39;
my $KATAKANA = "ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶ";
my $HIRAGANA = "ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをんゔゕゖ";
@@ -28,6 +28,7 @@ BEGIN { use_ok 'DenshiJisho::Lingua' }
is( romaji_to_kana('katchatta'), 'かっちゃった' );
is( romaji_to_kana('kawwaiixi'), 'かっわいいぃ' );
is( romaji_to_kana('ottosei'), 'おっとせい' );
+ is( romaji_to_kana('acchi'), 'あっち' );
# Katakana
is( romaji_to_kana('KANADESU'), 'カナデス' );
@@ -39,6 +40,7 @@ BEGIN { use_ok 'DenshiJisho::Lingua' }
is( romaji_to_kana('KATCHATTA'), 'カッチャッタ' );
is( romaji_to_kana('KAWWAIIXI'), 'カッワイイィ' );
is( romaji_to_kana('OTTOSEI'), 'オットセイ' );
+ is( romaji_to_kana('ACCHI'), 'アッチ' );
is( romaji_to_kana('KATAKANA desu'),'カタカナ です' );
# Non-Japanese
@@ -81,4 +83,4 @@ BEGIN { use_ok 'DenshiJisho::Lingua' }
is_deeply( [make_sql_wildcards(\@simple_tokens, '', '%')], ['some%', 'tokens%'] );
is_deeply( [make_sql_wildcards(\@simple_tokens, '%', '%')], ['%some%', '%tokens%'] );
is_deeply( [make_sql_wildcards(\@complicated_tokens)], ['some%', '%token', '_wo_ds\%\_'] );
-}
+}

0 comments on commit 3aeed01

Please sign in to comment.