# buggo, where's the case-sensitivity go, here or elsewhere? # the first subrule here... command: ( oops /\s+/ word { "(oops '$item[2])" } | ap { "(order me $item[1])" } | np ', ' ap { "(order $item[1] $item[3])" } ) ...!/\S/ { $item[1] } ap: { "(actions @{$item[1]})" } # buggo, omit thens in return vp: again /\s+/ { "'again" } | verb /\s+/ /\s+/ { $item[2] } np: { "(phrases @{$item[1]})" } basic_np: ( )(?) /\s+/ { "(phrases @{$item[1]} @{$item[2]})" } descriptor: article | all | other | number | possessive noun: me | pronoun | word verb: word { $::Verbs{$item[1]} } np_con: # todo # need to add to this prep: /o(:?n|ver|ff|ut of)|with(?:out)?|under|in(?:to)?| at|to|sans|from|toward/xi # buggo, doesn't parse word numbers as well as it should # should use module for that number_part: /([0-9]+)/ { $item[1] } | /one|t(?:w(?:o|e(?:lve|enty))|h(?:ree|ousand)|en)|f(?:our|ive)| s(?:ix|even)|e(?:ight|leven)|nine|zero| (?:thir|f(?:ou?r|if)|s(?:ix|even)|eigh|nine)t(?:een|y)| hundred|[mb]illion/ix { $::Numbers{$item[1]} } number: number_part /\s+/ | number_part /\s+/ number { [$item[1], $item[1] + $item[2], $item[1] * $item[2]] ->[$item[1] <=> $item[2]] } me: 'me' | 'myself' | 'i' | 'self' pronoun: 'it' | 'him' | 'you' | 'her' | 'them' possessive: 'my' | 'his' | 'her' | 'your' article: 'the' | 'a' | 'an' all: 'all' | 'every' other: 'other' oops: 'oops' | 'o' then: ',' 'then' | 'then' | '. ' again: 'again' | 'g' # would appear to be thought to end at the right-paren here word: /([a-zA-Z\-]+)/ v_go: direction { "(go '$item[1])" } direction: /((?:n(?:orth)?|s(?:outh)?)?(?:e(?:ast)?|w(?:est)?)?|(?:up|down))/i