|
our $VERSION = version->declare( 'v0.25.3' );
use if $^V ge v5.12.0, feature => 'unicode_strings' ;
BEGIN {
die "Transliteration requires Perl 5.18 or above"
unless $^V ge v5.18.0;
}
no warnings 'experimental::regex_sets' ;
has 'transforms' => (
is => 'ro' ,
isa => 'ArrayRef' ,
init_arg => undef ,
default => sub { [
qr/(?^umi:\G(?^u:(?[[㆒-㆟㈠-㉇㊀-㊰㋀-㋋㍘-㍰㍻-㍿㏠-㏾🈐-🈒🈔-🈺🉀-🉈🉐🉑] + [\p{ideographic} + \p{sc=han}]])))/ ,
{
type => 'transform' ,
data => [
{
from => q(fullwidth) ,
to => q(halfwidth) ,
},
],
},
{
type => 'conversion' ,
data => [
{
before => q() ,
after => q() ,
replace => q((?^u:。) ),
result => q(\Q'\E) ,
revisit => 0,
},
{
before => q((?^u:[\p{Ideographic}[\\.\,\:\;\?\!.,:?!。、; \p{Pe} \p{Pf}]]) ),
after => q((?^u:\p{Letter}) ),
replace => q() ,
result => q(\Q'\E) ,
revisit => 0,
},
{
before => q((?^u:\p{Letter}\p{Mark}*) ),
after => q((?^u:[\p{Ideographic}\p{Ps} \p{Pi}]) ),
replace => q() ,
result => q(\Q'\E) ,
revisit => 0,
},
]
},
] },
);
no Moose;
__PACKAGE__->meta->make_immutable;
1;
|