#3 Add support for commands with numbers

Closed
opened 7 years ago by clara · 2 comments
clara commented 7 years ago

One big feature I would like to see in Kaylee is the ability to have spoken commands with numbers in them. This could of course be brute-forced now, but I would like to be able to see something like this:

start a %d minute timer: sleep {0}m && echo "timer ended"

This would allow a user to speak a number in English in place of the %d. Kaylee would then parse this number and substitute its decimal representation in the command in place of {0}.

This feature will require some major architectural changes in Kaylee. A fixed set of words must be added to our corpus so that numbers can be parsed. Once we have a list of spoken words, matching those words to commands is more involved than it is now. I may want to do some research on parsing to determine the “right” way to do this. After this, we must turn the English number into a Python int. Finally, we must substitute it into the command. Overall, a redesign of the system is probably a good idea for this, and things will get bigger and chunkier.

One big feature I would like to see in Kaylee is the ability to have spoken commands with numbers in them. This could of course be brute-forced now, but I would like to be able to see something like this: ``` start a %d minute timer: sleep {0}m && echo "timer ended" ``` This would allow a user to speak a number in English in place of the %d. Kaylee would then parse this number and substitute its decimal representation in the command in place of {0}. This feature will require some major architectural changes in Kaylee. A fixed set of words must be added to our corpus so that numbers can be parsed. Once we have a list of spoken words, matching those words to commands is more involved than it is now. I may want to do some research on parsing to determine the "right" way to do this. After this, we must turn the English number into a Python int. Finally, we must substitute it into the command. Overall, a redesign of the system is probably a good idea for this, and things will get bigger and chunkier.
clara commented 7 years ago
Owner

One possible way to do this that doesn’t involve a lot of research: grab all strings of number-words for safe keeping, then replace them in the original text with %d. Match the string as usual, then parse the numbers and pass them into the executed command. This seems like a pretty simple method that would work reasonably well. It would require there to be strings of non-number words between each string of number-words, but that’s a reasonable thing to require.

One possible way to do this that doesn't involve a lot of research: grab all strings of number-words for safe keeping, then replace them in the original text with %d. Match the string as usual, then parse the numbers and pass them into the executed command. This seems like a pretty simple method that would work reasonably well. It would require there to be strings of non-number words between each string of number-words, but that's a reasonable thing to require.
clara commented 7 years ago
Owner

Implemented in a more clever, easier to understand way (involving parsing a string of word classes with re) as of 93f09d0d96. Closing the issue because the feature now works as described in the original comment.

Implemented in a more clever, easier to understand way (involving parsing a string of word classes with `re`) as of 93f09d0d9631bb1c90afd8744ca16bf4b7b79e3b. Closing the issue because the feature now works as described in the original comment.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Due Date

Dec 31, 0000 Overdue

Dependencies

This issue currently doesn't have any dependencies.

Loading…
Cancel
Save
There is no content yet.