Text-UnAbbrev

 view release on metacpan or  search on metacpan

lib/Text/UnAbbrev.pm  view on Meta::CPAN

sub _load_dict {
    my $self      = shift;
    my $dict_file = shift;

    my ( $language, $domain, $subdomain )
        = ( File::Spec::Functions::splitdir($dict_file) )[ -3, -2, -1 ];

    my $fh = IO::File->new( $dict_file, q(<:utf8) );
    while ( my $line = $fh->getline() ) {
        chomp $line;
        my ( $abbrev, $expansion ) = split m{\t+|\N{SPACE}{2,}}msx, $line;
        $abbrev = $self->_norm_abbrev($abbrev);
        push @{ $self->dict->{$language}{$domain}{$subdomain}{$abbrev} },
            $expansion;
    }
    $fh->close();

    return 1;
} ## end sub _load_dict

sub lookup {



( run in 0.957 second using v1.01-cache-2.11-cpan-71847e10f99 )