in reply to Re^3: Parsing human notations of numbers
in thread Parsing human notations of numbers

I think I will try to use Lingua::EN::Words2Nums in conjunction with Math::Expr to create atoms of a string that looks like "1/4" out of "one fourth", which it seems that it can do, and evaluate that string as an expression. I might even be tempted to just eval it, but i'm not sure about that, as it is user data.

-nuffin
zz zZ Z Z #!perl
  • Comment on Re^4: Parsing human notations of numbers

Replies are listed 'Best First'.
Re^5: Parsing human notations of numbers
by davido (Cardinal) on Jan 16, 2005 at 07:50 UTC

    If you're going to just eval it, first make sure you've got only numbers, and second, make sure the user didn't give a fraction with zero as the denominator. :)


    Dave