diff --git a/lib/Lingua/IT/Ita2heb.pm b/lib/Lingua/IT/Ita2heb.pm index 488a7b5..b935991 100644 --- a/lib/Lingua/IT/Ita2heb.pm +++ b/lib/Lingua/IT/Ita2heb.pm @@ -175,8 +175,9 @@ sub ita_to_heb { ## no critic (Subroutines::ProhibitExcessComplexity) $ita_letter ~~ @ALL_LATIN_VOWELS and ($seq->at_start or $seq->wrote_vowel) and not ( $ita_letter ~~ @TYPES_OF_I - and $seq->match_before([\@ALL_LATIN_VOWELS]) - and $seq->match_after([\@ALL_LATIN_VOWELS])) + and $seq->match_after([\@ALL_LATIN_VOWELS]) + and ( $seq->match_before([\@ALL_LATIN_VOWELS]) + or $seq->at_start)) ) { $heb .= $ALEF; @@ -284,7 +285,8 @@ sub ita_to_heb { ## no critic (Subroutines::ProhibitExcessComplexity) } elsif ($seq->match_after([\@ALL_LATIN_VOWELS])) { - if ($seq->match_before([\@ALL_LATIN_VOWELS])) { + if ( $seq->at_start + or $seq->match_before([\@ALL_LATIN_VOWELS])) { $hebrew_to_add .= $YOD; } else { diff --git a/t/08-i.t b/t/08-i.t index 9bcfc64..a657802 100755 --- a/t/08-i.t +++ b/t/08-i.t @@ -4,7 +4,7 @@ use 5.010; use strict; use warnings; -use Test::More tests => 2; +use Test::More tests => 3; use charnames ':full'; use lib './t/lib'; @@ -45,3 +45,18 @@ check_ita_tr( . "\N{HEBREW LETTER HE}", 'Gioiosa', ); + +# TEST +check_ita_tr( + ['Ionica'], + "\N{HEBREW LETTER YOD}" + . "\N{HEBREW LETTER VAV}" + . "\N{HEBREW POINT HOLAM}" + . "\N{HEBREW LETTER NUN}" + . "\N{HEBREW POINT HIRIQ}" + . "\N{HEBREW LETTER YOD}" + . "\N{HEBREW LETTER QOF}" + . "\N{HEBREW POINT QAMATS}" + . "\N{HEBREW LETTER HE}", + 'Ionica', +);