in reply to Re: change numbers in a corpus into words
in thread change numbers in a corpus into words

tx friend, it dosnt change all numbers t words, what i get is some numbers to words and sum not.... any idea? for example for 3 : 30 it returns 3 : thirty.
  • Comment on Re^2: change numbers in a corpus into words

Replies are listed 'Best First'.
Re^3: change numbers in a corpus into words
by kyle (Abbot) on Feb 05, 2008 at 22:48 UTC

    Oh, that's my pattern doing that (it requires a non-space character after the digit). Try this instead (single digits match):

    perl -MLingua::EN::Numbers -pe 's/(\d\S*)/Lingua::EN::Numbers::num2en( +$1) || $1/ge' < input_file > output_file
      thanks man, it works just got some minor changes that i think i would be able to fix. for example it dosnt change the digits stick to characters such as (1882) or 12s or 22nd which i guess ill change the Regexp n will fix... again tx alot.