Skip to content

Commit

Permalink
[Mod] Refactor grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
akinobu1998 committed Apr 9, 2023
1 parent 2862199 commit 94cf4f8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 23 deletions.
6 changes: 3 additions & 3 deletions GPSRCmdGen/Factory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ public static List<Category> GetDefaultObjects()
task.AddObject("block", GPSRObjectType.Known);
tmp.Add(task);

SpecificLocation livingroom = SpecificLocation.Placement("living room");
livingroom.Room = new Room("living room");
Category kitchen = new Category("kitchen items", livingroom);
SpecificLocation longtable_b = SpecificLocation.Placement("long table b");
longtable_b.Room = new Room("living room");
Category kitchen = new Category("kitchen items", longtable_b);
kitchen.AddObject("detergent", GPSRObjectType.Known);
kitchen.AddObject("cup", GPSRObjectType.Known);
kitchen.AddObject("lunch box", GPSRObjectType.Alike);
Expand Down
30 changes: 10 additions & 20 deletions GPSRCmdGen/Resources/Category0Grammar.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,26 @@ $count = (people in the {room} are {gesture} | {object} there are on the ${b

##############################################################################
#
# Navigation male: Go to the room, find person and follow / guide person.
# Navigation: Go to the room, find person and follow / guide person.
#
##############################################################################
$complex = $goroom, $findmale at the {placement 1} and ($vbfollow {name 1} | $vbguide him to the {placement 2})

$goroom = $vbgoto the {room}
$findmale = $vbfind {male 1}
$complex = $gofindmale and ($vbfollow {name 1} | $vbguide him to the {placement 2})
$complex = $gofindfemale and ($vbfollow {name 1} | $vbguide her to the {placement 2})

##############################################################################
#
# Navigation female: Go to the room, find person and follow / guide person.
# Speech: Go to the room, find person at the place and ask/answer question
#
##############################################################################
$complex = $goroom, $findfemale at the {placement 1} and ($vbfollow {name 1} | $vbguide her to the {placement 2})
$complex = $gofindmale and ($vbanswer his question | $vbask him {question}).
$complex = $gofindfemale and ($vbanswer her question | $vbask her {question}).

$findfemale = $vbfind {female 1}

$gofindmale = $goroom, $findmale at the {placement 1}
$gofindfemale = $goroom, $findmale at the {placement 1}

##############################################################################
#
# Speech: Go to the room, find person at the place and ask/answer question
#
##############################################################################
$complex = $goroom, $findmale at the {placement 1} and ($vbanswer his question | $vbask him {question}).
$complex = $goroom, $findfemale at the {placement 1} and ($vbanswer her question | $vbask her {question}).

$findmale = $vbfind {male 1}
$findfemale = $vbfind {female 1}

##############################################################################
#
Expand All @@ -74,7 +68,3 @@ $vbfollow = follow
$vbguide = guide
$vbask = ask
$vbanswer = answer

# $vbdeliver = bring | carry | deliver | take
# $vbfind = find
# $vbtake = grasp

0 comments on commit 94cf4f8

Please sign in to comment.