Lingua-TR-ASCII
view release on metacpan or search on metacpan
lib/Lingua/TR/ASCII.pm view on Meta::CPAN
turkish => $input,
};
bless $self, $class;
return $self;
}
# Convert a string with ASCII-only letters into one with Turkish letters.
sub _deasciify {
my($self) = @_;
my $s = \$self->{turkish};
my @chars = split m{}xms, ${$s};
for my $i ( 0 .. $#chars ) {
my $c = $chars[$i];
next if ! $self->_needs_correction( $c, $i );
substr ${$s}, $i, 1, $TOGGLE_ACCENT->{ $c } || $c;
}
return ${$s};
}
t/01-basic.t view on Meta::CPAN
my $test1 = q(a) x $i;
my $test2 = qq(\n) x $i;
my $test3 = qq(a\n) x $i;
is( $test1, $test1, "SIZE EQ($i) $test1" );
is( $test2, $test2, "SIZE EQ($i) \\n" );
is( $test3, $test3, "SIZE EQ(${i}a) \\n" );
}
sub _chars {
my($got, $expected, $id) = @_;
my @got = split m{}xms, $got;
my @expected = split m{}xms, $expected;
if ( @got == @expected ) {
my @buf;
while ( @got ) {
my $char_got = shift @got;
my $char_exp = shift @expected;
next if $char_got eq $char_exp;
push @buf, [ $char_got, $char_exp ];
}
if ( @buf ) {
require Data::Dumper;
( run in 1.340 second using v1.01-cache-2.11-cpan-71847e10f99 )