[TeamTalk 289]: [825] branches/air/Resources/Grammar: reorganized Grammar folder
air@edam.speech.cs.cmu.edu
air at edam.speech.cs.cmu.edu
Tue Oct 9 15:11:20 EDT 2007
An HTML attachment was scrubbed...
URL: http://mailman.srv.cs.cmu.edu/pipermail/teamtalk-developers/attachments/20071009/632cb724/attachment.html
-------------- next part --------------
Added: branches/air/Resources/Grammar/GRAMMAR/Number-20.class
===================================================================
--- branches/air/Resources/Grammar/GRAMMAR/Number-20.class (rev 0)
+++ branches/air/Resources/Grammar/GRAMMAR/Number-20.class 2007-10-09 19:11:20 UTC (rev 825)
@@ -0,0 +1,21 @@
+ (zero)
+ (one)
+ (two)
+ (three)
+ (four)
+ (five)
+ (six)
+ (seven)
+ (eight)
+ (nine)
+ (ten)
+ (eleven)
+ (twelve)
+ (thirteen)
+ (fourteen)
+ (fifteen)
+ (sixteen)
+ (seventeen)
+ (eighteen)
+ (nineteen)
+ (twenty)
Added: branches/air/Resources/Grammar/GRAMMAR/Number-60-by5.class
===================================================================
--- branches/air/Resources/Grammar/GRAMMAR/Number-60-by5.class (rev 0)
+++ branches/air/Resources/Grammar/GRAMMAR/Number-60-by5.class 2007-10-09 19:11:20 UTC (rev 825)
@@ -0,0 +1,12 @@
+ (five)
+ (ten)
+ (fifteen)
+ (twenty)
+ (twenty five)
+ (thirty)
+ (thirty five)
+ (forty)
+ (forty five)
+ (fifty)
+ (fifty five)
+ (sixty)
Added: branches/air/Resources/Grammar/GRAMMAR/Number-80-by5.class
===================================================================
--- branches/air/Resources/Grammar/GRAMMAR/Number-80-by5.class (rev 0)
+++ branches/air/Resources/Grammar/GRAMMAR/Number-80-by5.class 2007-10-09 19:11:20 UTC (rev 825)
@@ -0,0 +1,16 @@
+ (five)
+ (ten)
+ (fifteen)
+ (twenty)
+ (twenty five)
+ (thirty)
+ (thirty five)
+ (forty)
+ (forty five)
+ (fifty)
+ (fifty five)
+ (sixty)
+ (sixty five)
+ (seventy)
+ (seventy five)
+ (eighty)
Added: branches/air/Resources/Grammar/GRAMMAR/Number-85-95-by5.class
===================================================================
--- branches/air/Resources/Grammar/GRAMMAR/Number-85-95-by5.class (rev 0)
+++ branches/air/Resources/Grammar/GRAMMAR/Number-85-95-by5.class 2007-10-09 19:11:20 UTC (rev 825)
@@ -0,0 +1,4 @@
+ (eighty)
+ (eighty five)
+ (ninety)
+ (ninety five)
Added: branches/air/Resources/Grammar/GRAMMAR/Number-95-by5.class
===================================================================
--- branches/air/Resources/Grammar/GRAMMAR/Number-95-by5.class (rev 0)
+++ branches/air/Resources/Grammar/GRAMMAR/Number-95-by5.class 2007-10-09 19:11:20 UTC (rev 825)
@@ -0,0 +1,19 @@
+ (five)
+ (ten)
+ (fifteen)
+ (twenty)
+ (twenty five)
+ (thirty)
+ (thirty five)
+ (forty)
+ (forty five) #%%0.1%% there are more likely?
+ (fifty)
+ (fifty five)
+ (sixty)
+ (sixty five)
+ (seventy)
+ (seventy five)
+ (eighty)
+ (eighty five)
+ (ninety) #%%0.1%%
+ (ninety five)
Added: branches/air/Resources/Grammar/GRAMMAR/TeamTalkTask.forms
===================================================================
--- branches/air/Resources/Grammar/GRAMMAR/TeamTalkTask.forms (rev 0)
+++ branches/air/Resources/Grammar/GRAMMAR/TeamTalkTask.forms 2007-10-09 19:11:20 UTC (rev 825)
@@ -0,0 +1,43 @@
+###################################################################
+#
+# TeamTalk Grammar
+#
+# Written by: June Sison
+#
+# This is the forms file corresponding to the phoenix grammar for
+# the TeamTalk system
+#
+#
+# HISTORY -------------------------------------------------------
+#
+# [2005-09-21] (dbohus): added cancel
+# [2005-09-21] (tk): added yes/no
+# [2003-03-08] (sison): started working on this
+#
+###################################################################
+
+FUNCTION: Commands
+ NETS:
+ [InvokePlay]
+ [ControlRobot]
+ [QueryRobot]
+ [MoveRobot]
+ [RespondYesNo]
+# [HumanGoodbyeCommand]
+;
+
+FUNCTION: Features
+ NETS:
+ [AbsoluteDistance]
+ [TurnDirection]
+ [MoveDirection]
+;
+
+
+
+# these auxiliaries are defined in order to capture some parses like
+# next, this that, which o/w would parse as date-time
+#FUNCTION: Auxiliaries
+# NETS:
+# [__datetime_junk]
+#;
\ No newline at end of file
Added: branches/air/Resources/Grammar/GRAMMAR/TeamTalkTask.gra
===================================================================
--- branches/air/Resources/Grammar/GRAMMAR/TeamTalkTask.gra (rev 0)
+++ branches/air/Resources/Grammar/GRAMMAR/TeamTalkTask.gra 2007-10-09 19:11:20 UTC (rev 825)
@@ -0,0 +1,396 @@
+###################################################################
+#
+# TEAMTALK T A S K G R A M M A R
+#
+# HISTORY: -------------------------------------------------------
+#
+# [2003-03-08] (sison): started working on this
+#
+###################################################################
+
+[RobotName]
+ (everyone)
+ (%[DynamicRobotName]%) # class stub
+;
+
+[OBJ-Robot]
+ ([RobotName])
+;
+
+
+######### Main Nets ##############
+
+[InvokePlay]
+ ([HumanExploreCommand])
+ ([HumanSearchCommand])
+ ([HumanFollowCommand])
+;
+
+[ControlRobot]
+ ([HumanReportCommand])
+ ([HumanPauseCommand])
+ ([HumanContinueCommand])
+ ([HumanHaltCommand])
+ ([Cancel])
+;
+
+[QueryRobot]
+ ([HumanLocationQuery])
+;
+
+[MoveRobot]
+ ([HumanMoveCommand])
+ ([HumanTurnCommand])
+ ([MoveVectorRelative])
+# ([MoveVectorCardinal])
+ ([MoveToGoal])
+;
+
+[RespondYesNo]
+ ([Yes])
+ ([No])
+;
+
+###########################################
+
+
+
+[HumanExploreCommand]
+ (explore *[MapLocation])
+;
+
+[HumanSearchCommand]
+ (search *[MapLocation])
+ (search [MoveDirection])
+;
+
+[HumanFollowCommand]
+ (*[RobotName] FOLLOW [OBJ-Robot])
+FOLLOW
+ (join)
+ (follow)
+ (find)
+;
+
+[HumanPauseCommand]
+ (*[RobotName] pause *task *here)
+;
+
+[HumanContinueCommand]
+ (*[RobotName] continue *task)
+;
+
+[HumanReportCommand]
+ (*[RobotName] report)
+ ([RobotName])
+;
+
+[HumanLocationQuery]
+ (*[RobotName] where are you)
+ (*[RobotName] report location)
+;
+
+[HumanHaltCommand]
+ (*[RobotName] all stop)
+ (*[RobotName] stop immediately)
+;
+
+[Number-180-by5]
+ ( %[Number-95-by5]% ) #%%0.54%% # equalize the relative proportion
+ ( HUNDRED *and %[Number-80-by5]% ) #%%0.46%%
+HUNDRED
+ ( a hundred )
+ ( one hundred )
+;
+
+[Number-over180]
+ (*one hundred *and %[Number-95-by5]%) #%%0.1%%
+ (two hundred *and %[Number-95-by5]%) #%%0.5%%
+ (three hundred *and %[Number-60-by5]%) #%%0.4%%
+;
+
+[TurnDirection]
+ (*PREP SIDE *[AngularQualifier])
+ ([AngularQualifier] *PREP *SIDE)
+ (around)
+SIDE
+ (right)
+ (left)
+PREP
+ (to the)
+ (to your)
+;
+
+[MoveDirection]
+ (*PREP SIDE)
+ (straight)
+ (forward)
+ (forwards)
+ (back)
+ (backward)
+ (backwards)
+SIDE
+ (left)
+ (right)
+PREP
+ (to the)
+ (to your)
+;
+
+[AngularQualifier]
+ ([Number-180-by5] degrees) #%%0.667%%
+ ([Number-over180] degrees) #%%0.333%% # can do up to 360 deg's
+;
+
+
+[AbsoluteDistance]
+ (%[Number-20]% [Units])
+;
+
+[RelativeDistance]
+ ([TeamTalkAll] *of the way)
+ ([TeamTalkHalf] *of *the way)
+ ([TeamTalkThird] of the way)
+ ([TeamTalkTwoThird] of the way)
+ ([TeamTalkOneQuarter] of the way)
+ ([TeamTalkThreeQuarter] of the way)
+;
+
+[MapLocation]
+ (this space)
+ (the area)
+ (around *PLACE)
+ (PLACE)
+PLACE
+ (here)
+ (there)
+ (your location)
+;
+
+
+[TeamTalkAll]
+ (all)
+;
+
+[TeamTalkHalf]
+ (*MOD half)
+MOD
+ (one)
+ (a)
+;
+
+[TeamTalkThird]
+ (MOD third)
+MOD
+ (one)
+ (a)
+;
+
+[TeamTalkTwoThird]
+ (two third)
+ (two thirds)
+;
+
+[TeamTalkOneQuarter]
+ (one quarter)
+ (one fourth)
+ (a quarter)
+ (a fourth)
+;
+
+
+[TeamTalkThreeQuarter]
+ (three quarter)
+ (three quarters)
+ (three fourth)
+ (three fourths)
+;
+
+[HumanMoveCommand]
+# ([MoveVectorCardinal])
+ ([MoveVectorRelative])
+ ([MoveToGoal])
+;
+
+[Join]
+ (*[RobotName] join [RobotName])
+;
+
+#[MoveVectorCardinal]
+# (*[RobotName] MOVE *[CardinalDirection] [AbsoluteDistance])
+# (*[RobotName] MOVE [CardinalDirection])
+#
+#MOVE
+# (move)
+# (go)
+#;
+
+[MoveVectorRelative]
+ (*[RobotName] MOVE *[MoveDirection] [AbsoluteDistance])
+ (*[RobotName] MOVE *[AbsoluteDistance] [MoveDirection])
+MOVE
+ (move)
+ (go)
+ (drive)
+ (return)
+;
+
+[HumanTurnCommand]
+ (*[RobotName] TURN [TurnDirection])
+TURN
+ (turn)
+ (face)
+ (move)
+ (go)
+;
+[MoveToGoal]
+ (*[RobotName] MOVE *[RelativeDistance] PREP *[Side] [Goal])
+ (*[RobotName] MOVE [Home])
+MOVE
+ (move *to)
+ (go *to)
+ (drive *to)
+PREP
+ (toward)
+ (towards)
+ (to)
+ (down *to)
+ (down towards)
+ (up *to)
+ (up towards)
+;
+
+[Side]
+ (the=north=end=of)
+ (the=east=end=of)
+ (the=south=end=of)
+ (the=west=end=of)
+
+[Goal]
+ ([Home])
+ ([Xcoord] [Ycoord])
+;
+
+[Home]
+ (home)
+ (base)
+;
+
+[Xcoord]
+ (*NEG %[Number-20]%)
+NEG
+ (negative)
+ (minus)
+;
+
+[Ycoord]
+ (*NEG %[Number-20]%)
+NEG
+ (negative)
+ (minus)
+;
+
+[Units]
+ (metres)
+ (metre)
+# (feet)
+# (foot)
+# (yards)
+# (yard)
+;
+
+#[HumanGoodbyeCommand]
+# (goodbye)
+# (bye)
+# (mission complete)
+# (that's it)
+;
+
+
+
+
+###################################################################
+# YES/NO grammar
+###################################################################
+
+[Yes]
+ (YES *MOD)
+ (OKAY)
+ (WEAK_MOD) #%%0.10%% # weaks don't seem likely in this domain
+ (STRONG_MOD) #%%0.10%%
+YES
+ (yes)
+ (yeah)
+# (yup)
+MOD
+ (STRONG_MOD)
+ (WEAK_MOD)
+STRONG_MOD
+ (absolutely)
+ (definitely)
+ (OKAY OKAY)
+WEAK_MOD
+ (why not)
+ (i think so)
+ (i guess so)
+OKAY
+ (okay)
+ (sure)
+ (of course)
+ (correct)
+ (perfect)
+ (great)
+ (acceptable)
+ (good *enough)
+# (fine)
+# (wonderful)
+# (right)
+# (alright)
+;
+
+[No]
+ (no *MOD)
+ (*no absolutely not)
+ (nope)
+ (nah)
+ (no way)
+ (*no i DONT)
+ (*no i DONT think so)
+ (nevermind)
+ (not really)
+ (negative)
+# (nowhere)
+DONT
+ (don't)
+ (do not)
+MOD
+ (thanks)
+ (thank=you) # should be a lexeme
+ (not really)
+ (it's not)
+ (i'm not)
+#NO
+# (no)
+# (not)
+#GOOD
+# (right)
+# (correct)
+# (good)
+# (okay)
+;
+
+
+###################################################################
+# CANCEL grammar
+###################################################################
+
+[Cancel]
+ (CANCEL *COMMAND)
+CANCEL
+ (abort)
+ (cancel)
+ (quit)
+COMMAND
+ (*that command)
+ (that)
+;
\ No newline at end of file
Added: branches/air/Resources/Grammar/bin/compile.exe
===================================================================
(Binary files differ)
Property changes on: branches/air/Resources/Grammar/bin/compile.exe
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/air/Resources/Grammar/bin/concept_leaf.exe
===================================================================
(Binary files differ)
Property changes on: branches/air/Resources/Grammar/bin/concept_leaf.exe
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/air/Resources/Grammar/bin/parse.exe
===================================================================
(Binary files differ)
Property changes on: branches/air/Resources/Grammar/bin/parse.exe
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/air/Resources/Grammar/bin/pqual.exe
===================================================================
(Binary files differ)
Property changes on: branches/air/Resources/Grammar/bin/pqual.exe
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: branches/air/Resources/Grammar/bin/train.exe
===================================================================
(Binary files differ)
Property changes on: branches/air/Resources/Grammar/bin/train.exe
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: branches/air/Resources/Grammar/compile_gra.pl
===================================================================
--- branches/air/Resources/Grammar/compile_gra.pl 2007-10-09 15:51:27 UTC (rev 824)
+++ branches/air/Resources/Grammar/compile_gra.pl 2007-10-09 19:11:20 UTC (rev 825)
@@ -31,7 +31,8 @@
# HARDWIRED!!
if ( $classflag and -e 'TeamTalkRobots' ) {
open(IN,"TeamTalkRobots") or die "compile_gra: can't open TeamTalkRobots!\n";
- open(OUT,">DynamicRobotName.class") or die "compile_gra: can't open DynamicRobotName.class!\n";
+ open(OUT,">GRAMMAR/DynamicRobotName.class")
+ or die "compile_gra: can't open DynamicRobotName.class!\n";
while (<IN>) { chomp; print OUT "\t($_)\n"; }
}
@@ -47,17 +48,17 @@
}
# copy over the forms file
-open(TTFORMS, "$domain.forms") or die "compile_gra: no $ingra.forms file!\n";
+open(TTFORMS, "GRAMMAR/$domain.forms") or die "compile_gra: no $ingra.forms file!\n";
open(FORMS, ">forms");
print FORMS <TTFORMS>;
close TTFORMS; close FORMS;
# compile Phoenix grammar
-open(COMPILE, "compile -g . -f $project |");
+open(COMPILE, "bin/compile -g . -f $project |");
open(LOG, ">log"); print LOG <COMPILE>; close LOG;
close COMPILE;
-system("concept_leaf -grammar $project.net");
+system("bin/concept_leaf -grammar $project.net");
exit 1;
Modified: branches/air/Resources/Grammar/resolve.pl
===================================================================
--- branches/air/Resources/Grammar/resolve.pl 2007-10-09 15:51:27 UTC (rev 824)
+++ branches/air/Resources/Grammar/resolve.pl 2007-10-09 19:11:20 UTC (rev 825)
@@ -16,29 +16,25 @@
"absgra:s" => \$absfile,
) ) { die $usage; }
print STDERR "resolve: infile-> $infile; graex-> $expfile; grabs-> $absfile\n";
-open(IN,$infile) or die "resolve: can't open $infile!\n";
+open(IN,"GRAMMAR/$infile") or die "resolve: can't open $infile!\n";
open(OUT,">$expfile") or die "resolve: can't open expgra: $expfile!\n";
open(ABS,">$absfile") or die "resolve: can't open absgra: $absfile!\n";
my $postscript = <<EOS;
-############################################
-## Automatically generated class nets ##
-############################################
-############################################
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# ~ EXPANDED CLASS NETS ~
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
EOS
my $preamble = <<EOS;
-#
-#
-########################################################################
-## automatically generated intermediate grammar; DO NOT EDIT! ##
-########################################################################
-#
-#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# ~ AUTOMATICALLY GENERATED INTERMEDIATE GRAMMAR; DO NOT EDIT! ~
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
EOS
print OUT $preamble;
@@ -53,7 +49,7 @@
} else { print OUT "$_\n"; print ABS "$_\n"; next; }
if ( not defined $classnet{$file} ) {
print STDERR "resolve: defining $file\n";
- open(CLASS,"$file.class") or die "missing .class file: $file\n";
+ open(CLASS,"GRAMMAR/$file.class") or die "resolve: missing .class file: $file\n";
my $classset = "\n[$file]\n";
while (<CLASS>) {
chomp;
Modified: branches/air/Resources/Grammar/tokenize.pl
===================================================================
--- branches/air/Resources/Grammar/tokenize.pl 2007-10-09 15:51:27 UTC (rev 824)
+++ branches/air/Resources/Grammar/tokenize.pl 2007-10-09 19:11:20 UTC (rev 825)
@@ -1,8 +1,13 @@
#!E:/Perl/bin/perl.exe -w
-# convert a .class file into:
-# a) .probdef file b) .token file (for dict) c) .ctl file
-# [20070923] (air)
+#
+# convert absolute task grammar and its .class files into:
+# a) .ctl file
+# b) .probdef file
+# c) .token file (for pronounce dict)
+# d) .words (for lm wordlist)
+# [20070923] (air) Created.
+
use Getopt::Long;
use File::Basename;
@@ -25,7 +30,7 @@
# scan .gra file; make a list of classes that need to be processed
# also collect all terminals to make a wordlist (used in lm compilation)
my %classes = (); my %wordlist = ();
-open(GRA,$grafile) or die "tokenize: $grafile not found!\n$usage\n";
+open(GRA,"$grafile") or die "tokenize: $grafile not found!\n$usage\n";
while (<GRA>) {
chomp;
if ( /^\s*#/ or /^\s+$/ ) { next; } # skip comments, blank lines
@@ -58,7 +63,7 @@
foreach $classfil (sort keys %classes) {
$classid = $classes{$classfil};
$classfil =~ s/\[(.+?)\]/$1/; # strip []'s
- open(CLASS,"$classfil.class") or die "tokenize: class file $classfil not found";
+ open(CLASS,"GRAMMAR/$classfil.class") or die "tokenize: class file $classfil not found";
($classname,$dirn,$suffix) = fileparse($classfil,qr/\.[^.]*/);
my %lexset = ();
while (<CLASS>) {
More information about the TeamTalk-developers
mailing list