Improve speech recognition grammar

main
Isaiah Odhner 2020-05-11 13:41:08 -04:00
parent 573252cc8f
commit 0119d8b228
1 changed files with 6 additions and 1 deletions

View File

@ -126,7 +126,12 @@ grammar jspaintCommands;
<tool_name> = ${toolNames.join(' | ')};
<tool> = [the] <tool_name> [tool];
<pick-verb> = select | pick | choose | use | activate | "pick up" | grab;
public <command> = [<pick-verb>] (<color> | <tool>);
<stop> = stop | end | cease | (that's | that is) enough | enough of that | terminate | halt | put an end to [this] | break off;
// @TODO: is there an escape hatch for "any text here"?
<something> = [a|an] (something | thing | anything | dog | cat | house | mouse | bird | snake | tree | turtle | mountain | [smiley | smiling | happy | frowny | frowning | sad] face);
<draw> = draw | sketch | doodle | render | ((draw | sketch | doodle | render | do | paint) [a picture | an image | a drawing | a painting | a rendition | a sketch | a doodle) of]);
<draw-something> = <draw> <something>;
public <command> = [<pick-verb>] (<color> | <tool>) | <stop> | <draw-something>;
`;
const recognition = new SpeechRecognition();