Module Import alias Assign NameStore Dict Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num Num FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr If CompareIn NameLoad NameLoad body Return SubscriptLoad NameLoad Index NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Assert CompareGt Call NameLoad NameLoad Num If CompareEq SubscriptLoad NameLoad Index Num Str body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str If CompareEq SubscriptLoad NameLoad Index Num Str body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str If CompareEq SubscriptLoad NameLoad Index Num Str body Expr Call AttributeLoad NameLoad attr Num Str If CompareEq SubscriptLoad NameLoad Index Num Str body Expr Call AttributeLoad NameLoad attr Num Str Assign NameStore ListComp NameLoad comprehension NameStore NameLoad CompareNotIn NameLoad ListLoad Str Str Str Assign NameStore Str Assign NameStore NameLoad Assign NameStore Num For NameStore Call NameLoad NameLoad body If CompareEq NameLoad Str body Assign NameStore SubscriptLoad NameLoad Index NameLoad AugAssignAdd NameStore NameLoad If CompareGt NameLoad Num body Assign NameStore Str orelse Assign NameStore Str orelse If CompareEq NameLoad Str body If CompareNotEq NameLoad Str body Assign NameStore SubscriptLoad NameLoad Index NameLoad If CompareLt NameLoad Num body AugAssignAdd NameStore BinOpMult NameLoad Num orelse AugAssignAdd NameStore NameLoad Assign NameStore Str orelse If CompareEq NameLoad Str body If CompareNotIn NameLoad ListLoad Str Str body Assign NameStore SubscriptLoad NameLoad Index NameLoad AugAssignAdd NameStore BinOpMult NameLoad Num Assign NameStore Str orelse If CompareEq NameLoad Str body Assign NameStore Str orelse Assign NameStore Str orelse If CompareEq NameLoad Str body Assert CompareNotEq NameLoad Str If CompareNotEq NameLoad Str body Assign NameStore SubscriptLoad NameLoad Index NameLoad AugAssignAdd NameStore BinOpMult NameLoad Num orelse Assert CompareEq Str NameLoad Return NameLoad decorator_list
N/A N/A re N/A _known N/A zero one two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen twenty thirty forty fifty sixty seventy eighty ninety 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 30 40 50 60 70 80 90 spoken_word_to_number N/A N/A n N/A N/A N/A Assume n is a positive integer".
assert _positive_integer_number('nine hundred') == 900
assert spoken_word_to_number('one hundred') == 100
assert spoken_word_to_number('eleven') == 11
assert spoken_word_to_number('twenty two') == 22
assert spoken_word_to_number('thirty-two') == 32
assert spoken_word_to_number('forty two') == 42
assert spoken_word_to_number('two hundred thirty two') == 232
assert spoken_word_to_number('two thirty two') == 232
assert spoken_word_to_number('nineteen hundred eighty nine') == 1989
assert spoken_word_to_number('nineteen eighty nine') == 1989
assert spoken_word_to_number('one thousand nine hundred and eighty nine') == 1989
assert spoken_word_to_number('nine eighty') == 980
assert spoken_word_to_number('nine two') == 92 # wont be able to convert this one
assert spoken_word_to_number('nine thousand nine hundred') == 9900
assert spoken_word_to_number('one thousand nine hundred one') == 1901
 N/A n N/A N/A N/A N/A n lower strip N/A N/A n _known N/A N/A N/A _known N/A n N/A N/A inputWordArr N/A N/A re split [ -] n N/A N/A N/A len inputWordArr 1 N/A N/A N/A inputWordArr N/A -1 hundred N/A N/A N/A N/A inputWordArr append zero N/A N/A N/A inputWordArr append zero N/A N/A N/A inputWordArr N/A -1 thousand N/A N/A N/A N/A inputWordArr append zero N/A N/A N/A inputWordArr append zero N/A N/A N/A inputWordArr append zero N/A N/A N/A inputWordArr N/A 0 hundred N/A N/A N/A N/A inputWordArr insert 0 one N/A N/A N/A inputWordArr N/A 0 thousand N/A N/A N/A N/A inputWordArr insert 0 one N/A inputWordArr N/A word N/A word inputWordArr N/A word N/A and minus negative N/A currentPosition unit N/A prevPosition None N/A output 0 N/A word N/A reversed inputWordArr N/A N/A N/A currentPosition unit N/A N/A number N/A _known N/A word N/A output number N/A N/A number 9 N/A N/A currentPosition hundred N/A N/A currentPosition ten N/A N/A N/A currentPosition ten N/A N/A N/A word hundred N/A N/A number N/A _known N/A word N/A N/A number 10 N/A N/A output N/A number 10 N/A N/A output number N/A currentPosition hundred N/A N/A N/A currentPosition hundred N/A N/A N/A word N/A hundred thousand N/A N/A number N/A _known N/A word N/A output N/A number 100 N/A currentPosition thousand N/A N/A N/A word thousand N/A N/A currentPosition thousand N/A N/A currentPosition hundred N/A N/A N/A currentPosition thousand N/A N/A N/A word hundred N/A N/A word thousand N/A N/A number N/A _known N/A word N/A output N/A number 1000 N/A N/A N/A Can't be here None N/A output N/A