Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Converting words to numbers with HOP::Parser

by Ovid (Cardinal)
on Nov 05, 2005 at 21:25 UTC ( #506028=CUFP: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # there's some looseness here to account for people's mangling
    # of the English language
    
    ...
    
    ones           ::= zero | one  | two   | three | four
                     | five | six  | seven | eight | nine
    
  2. or download this
    package Number::FromWord;
    
    use warnings;
    ...
    }
    
    1;
    
  3. or download this
    #!perl 
    
    #use Test::More tests => 1;
    ...
        my ( $word, $num ) = splice @words, 0, 2;
        is word_to_num($word), $num, "... $word should be $num";
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://506028]
Approved by shenme
Front-paged by diotalevi
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2020-11-27 10:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?