Acme-Samurai

 view release on metacpan or  search on metacpan

lib/Acme/Samurai.pm  view on Meta::CPAN

    }
    
    if ($node->is('名詞') or $node->is('記号')) {
        
        # arabic number to kanji
        if ($node->pos1 eq 'æ•°' and $node->surface =~ /^[0-9]+$/) {
            # no 位
            if ($node->surface =~ /^0/ or
                $node->prev && $node->prev->surface =~ /[..]/) {
                
                $text = join "", map { num2ja($_) } split //, $node->surface;
            } else {
                $text = num2ja($node->surface); # with 位
            }
        }
        
        # kanji number to more classic
        elsif ($node->pos1 eq 'æ•°') {
            $text =~ tr{〇一二三四五六七八九十百万}
                       {零壱弐参四伍六七八九拾佰萬};
        }



( run in 1.025 second using v1.01-cache-2.11-cpan-49f99fa48dc )