Skip to content
Snippets Groups Projects
Commit f0c51db5 authored by lgraesner's avatar lgraesner Committed by Laurin Gräsner
Browse files

Set up two new grammar types for gpsr

parent 1c222ab4
No related branches found
No related tags found
1 merge request!9Merge GPSR changes
......@@ -9,7 +9,7 @@ alsadevice=sysdefault;
[pocketsphinxinstance]
name=Commands;
dict=../../../psGrammar/dictionary/tobiDic.dic;
jsgf=../../../psGrammar/tasks/gpsr/gpsr2.jsgf;
jsgf=../../../psGrammar/tasks/gpsr/gpsr23alternate.jsgf;
rsbscope=/speechrec/psa/commands;
bestpath=no;
autoload=yes;
......
#JSGF V1.0;
# This grammar tries to restrict task combinations by checking available and required references to places, items and persons. It doesn't work yet and is not worth continuing right now.
grammar speechRecognition;
public <sentence> = [could you | robot | tobi] [please] (<singleCommand> | <commandChain>)
= ([could you | robot | tobi] [please] <VP1> [([and|then] <VP2>)] [([and|then] <VP3>)]);
<singleCommand> = <standalone>;
# There needs to be a better way to check what combinations are possible
# meetName and findPrsInRoom generate both
person and location references, but the commands that my follow are unique for each case
<commandChain> = (<genLoc> [and|then] <reqLocGenPrs> [and|then] <reqPrs>)
| (<genLoc> [and|then] <reqLocGenPrs> [and|then] <noReq>)
| (<genLoc> [and|then] <reqLocGenItem> [and|then] <reqItem>)
| (<meetPrsAtBeac> [and|then] <reqPrsMOVE> [and|then] <reqPrsMOVE>)
| (<meetPrsAtBeac> [and|then] <reqPrs> [[and|then] <noReq>)
| (<genLocPrs> [and|then] <reqPrs> [[and|then] <noReq>])
<noReq> = (<genLoc> | <genPrs> | <genItem>);
<genLoc> = <goToLoc>;
<genPrs> =
<genItem> = (<takeObjFromPlcmt> | <takeObj>);
<genLocPrs> = (<meetPrsAtBeac> | <findPrsInRoom>);
<reqLocGenPrs> = (<findPrs> | <meetName>);
<reqLocGenItem>= <findObj>;
<reqPrsMOVE> = (<followPrsToRoom> | <followPrs> | <guidePrsToBeacon>);
<reqPrsTALK> = (<answerQuestion> | <talkInfo>;
<reqLocPrs> = <guidePrsBack>;
<reqItem> = (<deliverObjPronToMe> | <placeObjPronOnPlcmt> | <placeObjOnPlcmt> | <deliverObjToNameAtBeac>)
<standalone> = <deliverObjToMe> | <deliverObjToGestPrsInRoom> | <countObjOnPlcmt> | <countPrsInRoom> | <tellPrsInfoInLoc> | <tellObjPropOnPlcmt> | | <followNameFromBeacToRoom> | <guideNameFromBeacToBeac> | <guideNameToBeacFindAtBeac> | <bringMeObj> | <bringMeObjFromPlcmt> | <tellCatPropOnPlcmt> | <findObjInRoom> | <talkInfoToGestPrsInRoom> | <answerToGestPrsInRoom>);
<goToLoc> = <V_go> <toLocPrep> (<NP_room> | <NP_placement> | <NP_beacon>);
<findObj> = <V_find> <NP_object>;
<findObjInRoom> = <V_find> (<NP_object> | <NP_category>) <inLocPrep> <NP_room>;
<takeObj> = <V_take> <NP_object>;
<takeObjFromPlcmt> = <V_take> <NP_object> <fromLocPrep> (<NP_room> | <NP_placement>);
<findPrs> = <V_find> (<NP_gestperson> | <NP_genderperson> | <NP_poseperson>);
<findPrsInRoom> = <V_find> (<NP_gestperson> | <NP_genderperson> | <NP_poseperson>) <inLocPrep> <NP_room>;
<placeObjOnPlcmt> = <V_place> <NP_object> <placePrep> <NP_placement>;
<placeObjPronOnPlcmt> = <V_place> <NP_objectpron> <placePrep> <NP_placement>;
<talkInfo> = <V_talk> <NP_talk>;
<talkInfoToGestPrsInRoom> = <V_talk> <NP_talk> <talkPrep> <NP_gestperson> <inLocPrep> <NP_room>;
<answerQuestion> = <V_answer> <NP_answer>;
<answerToGestPrsInRoom> = <V_answer> <NP_answer> <talkPrep> <NP_gestperson> <inLocPrep> <NP_room>;
<followPrs> = <V_follow> <NP_personalpron>;
<followPrsToRoom> = <V_follow> <NP_personalpron> <toLocPrep> <NP_roomTwo>;
<followNameFromBeacToRoom> = <V_follow> <NP_name> <fromLocPrep> <NP_beacon> <toLocPrep> <NP_roomTwo>;
<meetName> = <V_meet> <NP_name>;
<meetPrsAtBeac> = <V_meet> <NP_name> <atLocPrep> <NP_beacon>;
<bringMeObj> = <V_bring> <NP_me> <NP_object>;
<bringMeObjFromPlcmt> = <V_bring> <NP_me> <NP_object> <fromLocPrep> <NP_placement>;
<countObjOnPlcmt> = <V_count> (<NP_object> | <NP_category>) there are <placePrep> <NP_placement>;
<countPrsInRoom> = <V_count> people in <NP_room> <arePrep> (<NP_posture> | <NP_genderpersonplural>);
<tellPrsInfoInLoc> = <V_tell> me <NP_personattribute> of the person <LocPrep> (<NP_room> | <NP_beacon>);
<tellObjPropOnPlcmt> = <V_tell> me ((what is) | whats) <NP_objectprop> object <onLocPrep> <NP_placement>;
<tellCatPropOnPlcmt> = <V_tell> me ((what is) | whats) <NP_objectprop> <NP_category> <onLocPrep> <NP_placement>;
<deliverObjToMe> = <V_deliver> <NP_object> <deliverPrep> <NP_me>;
<deliverObjPronToMe> = <V_deliver> <NP_objectpron> <deliverPrep> <NP_me>;
<deliverObjToGestPrsInRoom> = <V_deliver> [<NP_objectpron>] <NP_object> <deliverPrep> <NP_gestperson> <inLocPrep> <NP_roomTwo>;
<deliverObjToNameAtBeac> = <V_deliver> <NP_objectpron> <deliverPrep> <NP_name> <atLocPrep> <NP_beaconTwo>;
<guidePrsBack> = <V_guide> <NP_personalpron> back;
<guidePrsToBeacon> = <V_guide> <NP_personalpron> <toLocPrep> <NP_beaconTwo>;
<guideNameFromBeacToBeac> = <V_guide> <NP_name> <fromLocPrep> <NP_beacon> <toLocPrep> <NP_beaconTwo>;
<guideNameToBeacFindAtBeac> = <V_guide> <NP_name> <toLocPrep> <NP_beaconTwo> you (may | can | will) find (them | him | her) <atLocPrep> <NP_beacon>;
<deliverPrep> = to;
<placePrep> = on;
<inLocPrep> = in;
<fromLocPrep> = from;
<toLocPrep> = to;
<atLocPrep> = at;
<talkPrep> = to;
<LocPrep> = in | at;
<onLocPrep> = on;
<arePrep> = are;
<V_take> = bring | take | get | grasp | (pick up);
<V_place> = put | place;
<V_deliver> = bring | give | deliver;
<V_bring> = bring | give;
<V_go> = go | navigate;
<V_find> = find | locate | (look for);
<V_talk> = tell | say;
<V_answer> = answer;
<V_follow> = follow;
<V_meet> = meet | face | contact;
<V_guide> = guide | escort | take | lead | accompany;
<V_tell> = tell;
<V_count> = tell me how many;
<NP_object> = (the <N_object>) | (a <N_object>) | (an <N_object>) | (<N_object>);
<NP_objectpron> = (<N_objectpron>);
<NP_category> = (the <N_category>) | <N_category>;
<NP_objectprop> = (the <N_objectprop>);
<NP_placement> = (the <N_placement>);
<NP_placementTwo> = (the <N_placementTwo>);
<NP_beacon> = (the <N_beacon>);
<NP_beaconTwo> = (the <N_beaconTwo>);
<NP_room> = (the <N_room>);
<NP_roomTwo> = (the <N_roomTwo>);
<NP_me> = (<N_me>);
<NP_gestperson> = (the <N_gestperson>) | (a <N_gestperson>);
<NP_poseperson> = (a <N_poseperson>);
<NP_genderperson> = (a <N_genderperson>);
<NP_genderpersonplural> = (<N_genderpersonplural>);
<NP_name> = <N_name>;
<NP_talk> = <N_talk>;
<NP_answer> = <N_answer>;
<NP_personalpron> = <N_personalpron>;
<NP_personattribute> = (the <N_personattribute>);
<NP_posture> = <N_posture>;
<N_objectpron> = it;
<N_objectprop> = biggest | largest | smallest | heaviest | lightest | thinnest;
<N_me> = me;
<N_gestperson> = (person waving) | (person (raising | rising) [their] (left|right) arm) | (person pointing to the (left|right)) | (person calling);
<N_poseperson> = (person sitting) | (person standing) | (person lying down);
<N_genderperson> = man | woman | boy | girl | (male person) | (female person);
<N_genderpersonplural> = men | women | boys | girls | male | female;
<N_talk> = (something about yourself) | (the time) | (what day is (today | tomorrow)) | (your teams (name | country | affiliation)) | (the day of the (week | month)) | (a joke);
<N_answer> = (a question);
<N_personalpron> = them | her | him;
<N_personattribute> = name | gender | pose;
<N_posture> = sitting | standing | lying down;
<N_object_old> = basket | cereals | cloth | (coconut milk) | coke | cornflakes | noodles | orange (juice | drink) | peas | plate | pringles | red bowl | salt | soap | sponge | (tomato paste) | water;
<N_object> = (chocolate milk) | milk | cola | (soap box) | (choco krispies) | bowl | plate | fork | knife | spoon | cup | lemon | banana | peach | pear;
<N_category_old> = care | drink | (cleaning stuff) | container | food | snack | cutlery;
<N_category> = fruits | cutlery | drinks | snacks | (pantry items);
<N_room_old> = corridor | (living room) | kitchen | (bath room);
<N_room> = kitchen | (living room) | hallway | bathroom | office;
<N_roomTwo> = corridor | (living room) | kitchen | (bath room);
<N_placement_old> = (living table) | (kitchen counter) | sink | stove | cabinet | bar;
<N_placementTwo_old> = (living table) | (kitchen counter) | sink | stove | cabinet | bar;
<N_placement> = (kitchen table) | desk | (side board) | (side table) | sink | (kitchen counter) | cabinet | workstation;
<N_placementTwo> = (kitchen table) | desk | (side board) | (side table) | sink | (kitchen counter) | cabinet | workstation;
<N_beacon_old> = (living table) | sink | bar | sofa | fridge | (comfy chair);
<N_beaconTwo_old> = (living table) | sink | bar | sofa | fridge | (comfy chair);
<N_beacon> = fridge | sink | dishwasher | (easy chair) | (arm chair) | (kitchen table) | workstation;
<N_beaconTwo> = fridge | sink | dishwasher | (easy chair) | (arm chair) | (kitchen table) | workstation;
<N_name_old> = emma | olivia | sophia | ava | isabella | mia | abigail | emily | charlotte | harper | noah | liam | mason | jacob | william | ethan | james | alexander | michael | benjamin;
<N_name> = amelia | angel | ava | charlie | charlotte | hunter | max | mia | olivia | parker | sam | jack | noah | oliver | thomas | william;
#JSGF V1.0;
# This grammar tries to restrict task combinations by checking available and required references to places, items and persons. It doesn't work yet and is not worth continuing right now.
grammar speechRecognition;
public <sentence> = [could you | robot | tobi] [please] <command>;
command = (<cmdfndppl> | <cmdfndobj> | <cmdguide> | <cmdfollow> | <cmdfollowout> | <cmdincomplete> | <cmdman> | <complexman> | <cmdpartyhost>);
#Base commands
<cmdfndppl> = <tellPrsInfoInLoc> | <countPrsInRoom>;
<cmdfndobj> = <findObjInRoom> | <countObjOnPlcmt> | <tellCatPropOnPlcmt> | <tellObjPropOnPlcmt>;
<cmdguide> = <guideNameFromBeacToBeac>
| (<meetPrsAtBeac> and <guidePrsToBeacon>)
| (<goToLoc> <meetName> and <guidePrsToBeacon>);
<cmdfollow> = <followNameFromBeacToRoom>
| (<meetPrsAtBeac> and (<followPrs> | <followPrsToRoom>))
| (<goToLoc> <meetName> and (<followPrs> | <followPrsToRoom>));
<cmdfollowout> = <meetPrsAtBeac> <followPrs> and (<goToLoc> | <guidePrsBack>);
<cmdincomplete> = noGrammarMatch;
<cmdman> = <bringMeObjFromPlcmt>
| (<takefrom> and (<deliverObjPronToMe> | <deliverObjToNameAtBeac>))
| (<takefrom> and <placeObjPronOnPlcmt>);
<complexman> = noGrammarMatch;
<cmdpartyhost> = noGrammarMatch;
#Tasks the command consists out of
<goToLoc> = <V_go> <toLocPrep> (<NP_room> | <NP_placement> | <NP_beacon>);
<findObj> = <V_find> <NP_object>;
<findObjInRoom> = <V_find> (<NP_object> | <NP_category>) <inLocPrep> <NP_room>;
<takeObj> = <V_take> <NP_object>;
<takeObjFromPlcmt> = <V_take> <NP_object> <fromLocPrep> (<NP_room> | <NP_placement>);
<findPrs> = <V_find> (<NP_gestperson> | <NP_genderperson> | <NP_poseperson>);
<findPrsInRoom> = <V_find> (<NP_gestperson> | <NP_genderperson> | <NP_poseperson>) <inLocPrep> <NP_room>;
<placeObjOnPlcmt> = <V_place> <NP_object> <placePrep> <NP_placement>;
<placeObjPronOnPlcmt> = <V_place> <NP_objectpron> <placePrep> <NP_placement>;
<talkInfo> = <V_talk> <NP_talk>;
<talkInfoToGestPrsInRoom> = <V_talk> <NP_talk> <talkPrep> <NP_gestperson> <inLocPrep> <NP_room>;
<answerQuestion> = <V_answer> <NP_answer>;
<answerToGestPrsInRoom> = <V_answer> <NP_answer> <talkPrep> <NP_gestperson> <inLocPrep> <NP_room>;
<followPrs> = <V_follow> <NP_personalpron>;
<followPrsToRoom> = <V_follow> <NP_personalpron> <toLocPrep> <NP_roomTwo>;
<followNameFromBeacToRoom> = <V_follow> <NP_name> <fromLocPrep> <NP_beacon> <toLocPrep> <NP_roomTwo>;
<meetName> = <V_meet> <NP_name>;
<meetPrsAtBeac> = <V_meet> <NP_name> <atLocPrep> <NP_beacon>;
<bringMeObj> = <V_bring> <NP_me> <NP_object>;
<bringMeObjFromPlcmt> = <V_bring> <NP_me> <NP_object> <fromLocPrep> <NP_placement>;
<countObjOnPlcmt> = <V_count> (<NP_object> | <NP_category>) there are <placePrep> <NP_placement>;
<countPrsInRoom> = <V_count> people in <NP_room> <arePrep> (<NP_posture> | <NP_genderpersonplural>);
<tellPrsInfoInLoc> = <V_tell> me <NP_personattribute> of the person <LocPrep> (<NP_room> | <NP_beacon>);
<tellObjPropOnPlcmt> = <V_tell> me ((what is) | whats) <NP_objectprop> object <onLocPrep> <NP_placement>;
<tellCatPropOnPlcmt> = <V_tell> me ((what is) | whats) <NP_objectprop> <NP_category> <onLocPrep> <NP_placement>;
<deliverObjToMe> = <V_deliver> <NP_object> <deliverPrep> <NP_me>;
<deliverObjPronToMe> = <V_deliver> <NP_objectpron> <deliverPrep> <NP_me>;
<deliverObjToGestPrsInRoom> = <V_deliver> [<NP_objectpron>] <NP_object> <deliverPrep> <NP_gestperson> <inLocPrep> <NP_roomTwo>;
<deliverObjToNameAtBeac> = <V_deliver> <NP_objectpron> <deliverPrep> <NP_name> <atLocPrep> <NP_beaconTwo>;
<guidePrsBack> = <V_guide> <NP_personalpron> back;
<guidePrsToBeacon> = <V_guide> <NP_personalpron> <toLocPrep> <NP_beaconTwo>;
<guideNameFromBeacToBeac> = <V_guide> <NP_name> <fromLocPrep> <NP_beacon> <toLocPrep> <NP_beaconTwo>;
<guideNameToBeacFindAtBeac> = <V_guide> <NP_name> <toLocPrep> <NP_beaconTwo> you (may | can | will) find (them | him | her) <atLocPrep> <NP_beacon>;
<deliverPrep> = to;
<placePrep> = on;
<inLocPrep> = in;
<fromLocPrep> = from;
<toLocPrep> = to;
<atLocPrep> = at;
<talkPrep> = to;
<LocPrep> = in | at;
<onLocPrep> = on;
<arePrep> = are;
<V_take> = bring | take | get | grasp | (pick up);
<V_place> = put | place;
<V_deliver> = bring | give | deliver;
<V_bring> = bring | give;
<V_go> = go | navigate;
<V_find> = find | locate | (look for);
<V_talk> = tell | say;
<V_answer> = answer;
<V_follow> = follow;
<V_meet> = meet | face | contact;
<V_guide> = guide | escort | take | lead | accompany;
<V_tell> = tell;
<V_count> = tell me how many;
<NP_object> = (the <N_object>) | (a <N_object>) | (an <N_object>) | (<N_object>);
<NP_objectpron> = (<N_objectpron>);
<NP_category> = (the <N_category>) | <N_category>;
<NP_objectprop> = (the <N_objectprop>);
<NP_placement> = (the <N_placement>);
<NP_placementTwo> = (the <N_placementTwo>);
<NP_beacon> = (the <N_beacon>);
<NP_beaconTwo> = (the <N_beaconTwo>);
<NP_room> = (the <N_room>);
<NP_roomTwo> = (the <N_roomTwo>);
<NP_me> = (<N_me>);
<NP_gestperson> = (the <N_gestperson>) | (a <N_gestperson>);
<NP_poseperson> = (a <N_poseperson>);
<NP_genderperson> = (a <N_genderperson>);
<NP_genderpersonplural> = (<N_genderpersonplural>);
<NP_name> = <N_name>;
<NP_talk> = <N_talk>;
<NP_answer> = <N_answer>;
<NP_personalpron> = <N_personalpron>;
<NP_personattribute> = (the <N_personattribute>);
<NP_posture> = <N_posture>;
<N_objectpron> = it;
<N_objectprop> = biggest | largest | smallest | heaviest | lightest | thinnest;
<N_me> = me;
<N_gestperson> = (person waving) | (person (raising | rising) [their] (left|right) arm) | (person pointing to the (left|right)) | (person calling);
<N_poseperson> = (person sitting) | (person standing) | (person lying down);
<N_genderperson> = man | woman | boy | girl | (male person) | (female person);
<N_genderpersonplural> = men | women | boys | girls | male | female;
<N_talk> = (something about yourself) | (the time) | (what day is (today | tomorrow)) | (your teams (name | country | affiliation)) | (the day of the (week | month)) | (a joke);
<N_answer> = (a question);
<N_personalpron> = them | her | him;
<N_personattribute> = name | gender | pose;
<N_posture> = sitting | standing | lying down;
<N_object_old> = basket | cereals | cloth | (coconut milk) | coke | cornflakes | noodles | orange (juice | drink) | peas | plate | pringles | red bowl | salt | soap | sponge | (tomato paste) | water;
<N_object> = (chocolate milk) | milk | cola | (soap box) | (choco krispies) | bowl | plate | fork | knife | spoon | cup | lemon | banana | peach | pear;
<N_category_old> = care | drink | (cleaning stuff) | container | food | snack | cutlery;
<N_category> = fruits | cutlery | drinks | snacks | (pantry items);
<N_room_old> = corridor | (living room) | kitchen | (bath room);
<N_room> = kitchen | (living room) | hallway | bathroom | office;
<N_roomTwo> = corridor | (living room) | kitchen | (bath room);
<N_placement_old> = (living table) | (kitchen counter) | sink | stove | cabinet | bar;
<N_placementTwo_old> = (living table) | (kitchen counter) | sink | stove | cabinet | bar;
<N_placement> = (kitchen table) | desk | (side board) | (side table) | sink | (kitchen counter) | cabinet | workstation;
<N_placementTwo> = (kitchen table) | desk | (side board) | (side table) | sink | (kitchen counter) | cabinet | workstation;
<N_beacon_old> = (living table) | sink | bar | sofa | fridge | (comfy chair);
<N_beaconTwo_old> = (living table) | sink | bar | sofa | fridge | (comfy chair);
<N_beacon> = fridge | sink | dishwasher | (easy chair) | (arm chair) | (kitchen table) | workstation;
<N_beaconTwo> = fridge | sink | dishwasher | (easy chair) | (arm chair) | (kitchen table) | workstation;
<N_name_old> = emma | olivia | sophia | ava | isabella | mia | abigail | emily | charlotte | harper | noah | liam | mason | jacob | william | ethan | james | alexander | michael | benjamin;
<N_name> = amelia | angel | ava | charlie | charlotte | hunter | max | mia | olivia | parker | sam | jack | noah | oliver | thomas | william;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment