MikeHopcroft / ShortOrder

A natural language conversational agent for ordering and organizing items from a catalog.
MIT License
13 stars 7 forks source link

Ending an utterance with a number results in a parsing error #44

Closed drub0y closed 5 years ago

drub0y commented 5 years ago

Any utterance that ends in a number seems to trigger the following error. For example, if you say something like "ok, that will be seventeen forty three".

Exception has occurred: TypeError
TypeError: PeekableSequence<T>.peek(): at end of stream.
    at PeekableSequence.peek (c:\Users\drmarsh\Source\Repositories\Starbucks\ramsey-backend\node_modules\token-flow\build\src\utilities\peekable_sequence.js:13:19)
    at Parser.parseEntity (c:\Users\drmarsh\Source\Repositories\Starbucks\ramsey-backend\node_modules\short-order\build\src\parser\parser.js:120:49)
    at Parser.parseRoot (c:\Users\drmarsh\Source\Repositories\Starbucks\ramsey-backend\node_modules\short-order\build\src\parser\parser.js:41:30)
    at Parser.parseTokens (c:\Users\drmarsh\Source\Repositories\Starbucks\ramsey-backend\node_modules\short-order\build\src\parser\parser.js:35:21)
    at Parser.parseText (c:\Users\drmarsh\Source\Repositories\Starbucks\ramsey-backend\node_modules\short-order\build\src\parser\parser.js:31:21)
    at Object.<anonymous> (c:\Users\drmarsh\Source\Repositories\Starbucks\ramsey-backend\src\utterance-processing\short-order\index.ts:38:50)
    at Generator.next (<anonymous>)
    at c:\Users\drmarsh\Source\Repositories\Starbucks\ramsey-backend\dist\utterance-processing\short-order\index.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (c:\Users\drmarsh\Source\Repositories\Starbucks\ramsey-backend\dist\utterance-processing\short-order\index.js:3:12)
MikeHopcroft commented 5 years ago

Another example: % i'll have lattes five

TypeError: PeekableSequence.peek(): at end of stream. at PeekableSequence.peek (/Users/mhop/git/menubot/shortorder/node_modules/token-flow/build/src/utilities/peekable_sequence.js:13:19) at Parser.parseEntity (/Users/mhop/git/menubot/shortorder/build/src/parser/parser.js:120:49) at Parser.parseRoot (/Users/mhop/git/menubot/shortorder/build/src/parser/parser.js:41:30) at Parser.parseTokens (/Users/mhop/git/menubot/shortorder/build/src/parser/parser.js:35:21) at Parser.parseText (/Users/mhop/git/menubot/shortorder/build/src/parser/parser.js:31:21) at REPLServer.myEval (/Users/mhop/git/menubot/shortorder/build/src/repl/repl.js:172:36) at bound (domain.js:396:14) at REPLServer.runBound [as eval] (domain.js:409:12) at REPLServer.onLine (repl.js:642:10) at REPLServer.emit (events.js:182:13)