[TeamTalk 96]: [633] TeamTalk: 1) don' t consider missing target to be an error for testLastConfig in utils
tk@edam.speech.cs.cmu.edu
tk at edam.speech.cs.cmu.edu
Mon Jun 11 12:47:47 EDT 2007
An HTML attachment was scrubbed...
URL: http://mailman.srv.cs.cmu.edu/pipermail/teamtalk-developers/attachments/20070611/e98460cc/attachment-0001.html
-------------- next part --------------
Modified: TeamTalk/Agents/PrimitiveComm/utils.cpp
===================================================================
--- TeamTalk/Agents/PrimitiveComm/utils.cpp 2007-06-10 03:20:30 UTC (rev 632)
+++ TeamTalk/Agents/PrimitiveComm/utils.cpp 2007-06-11 16:47:47 UTC (rev 633)
@@ -247,9 +247,8 @@
#else
if(stat(target.c_str(), &target_stat)) {
#endif
- error << "problem stating target: " << target << endl;
- return false;
- }
- return target_stat.st_mtime > source_stat.st_mtime;
+ return false;
}
+ return target_stat.st_mtime > source_stat.st_mtime;
+}
Modified: TeamTalk/Agents/TeamTalkBackend/robot-galaxy_adapter.cpp
===================================================================
--- TeamTalk/Agents/TeamTalkBackend/robot-galaxy_adapter.cpp 2007-06-10 03:20:30 UTC (rev 632)
+++ TeamTalk/Agents/TeamTalkBackend/robot-galaxy_adapter.cpp 2007-06-11 16:47:47 UTC (rev 633)
@@ -58,22 +58,13 @@
void GalaxyRobots::addRobotNamesToGrammar(const vector<string>& names)
{
debug << "adding robot names to grammar:";
- map<string, string> subs;
- {
- ostringstream gname;
- for(vector<string>::const_iterator i = names.begin(); i != names.end(); i++) {
- gname << " (" << tolower(*i) << ')' << endl;
- }
- subs["%%RobotNames%%"] = gname.str();
- debug << ' ' << gname.str();
- }
- debug << endl;
- Agent::writeSpecializedConfig("..\\..\\Resources\\Grammar\\TeamTalkTask", "gra",
- subs);
+ ofstream namefile("..\\..\\Resources\\Grammar\\TeamTalkRobots");
+ for(vector<string>::const_iterator i = names.begin(); i != names.end(); i++) {
+ namefile << tolower(*i) << endl;
+ }
PROCESS_INFORMATION lm_build_proc =
- spawn(true, "Language Build", "..\\..\\Tools\\MakeLM", "perl",
- "makelm.pl TeamTalk ..\\..\\Resources");
+ spawn(true, "Language Build", "..\\..\\Tools\\MakeLM", "perl", "makelm.pl");
}
void GalaxyRobots::traderlistener(void *p)
@@ -253,7 +244,7 @@
r_client = new TeamTalk::RobotsClient("tester");
vector<string> names = processPeerfile("peerfile.txt");
if(!testLastConfig("peerfile.txt",
- "..\\..\\Resources\\DecoderConfig\\LanguageModel\\TeamTalkLM.arpa")) {
+ "..\\..\\Resources\\Grammar\\TeamTalkRobots")) {
addRobotNamesToGrammar(names);
}
if(!m_client->isConnected()) {
Deleted: TeamTalk/Resources/Grammar/Scenarios.txt
===================================================================
--- TeamTalk/Resources/Grammar/Scenarios.txt 2007-06-10 03:20:30 UTC (rev 632)
+++ TeamTalk/Resources/Grammar/Scenarios.txt 2007-06-11 16:47:47 UTC (rev 633)
@@ -1,132 +0,0 @@
-What is the basic functionality that should be provided ?
-
-1. Finding a free room according to criteria, and
- making a reservation
-
-2. Checking the schedule for a room (i.e. who's in there)
-
-
-
-
-Now, let's say we're doing just 1. The main ingredients would
-be.
-
--Login (user needs to provide name, credentials)
--Identifying a room. Constraints include:
- - which room
- - location (Wean, NSH) / number
- - time specification
- - day, period
- - recurrent/not
- - recurrent characteristics:
- (every week, every other week, etc)
- - room size (number of persons)
- - room accessories:
- - projector
- - whiteboard
- - network connectivity
- - etc...
--Making the reservation.
--Bye
-
-
-Here are a couple of scenarios ________________________________________
-
-
-S: Hi, welcome to RoomLine. Tell me your name
-U: Hi, I'm Renee... I need a conference room in Newell Simon
- for tomorrow morning at 10 am
-S: Good morning Renee. I have NSH 4513 free until 12. Is the good.
-U: Does it have a projector
-S: Yes. It also has audio, network connectivity and a dry-erase board
-U: Okay, can I make a reservation for that one.
-S: Sure. I have reserved NSH 4513 for you for tomorrow, April 16th,
- from 10 till 12 am. Is that okay ?
-U: Yes.
-S: Is there anything else I could do for you today ?
-U: No, thanks, bye
-
-
-
-S: Hi, welcome to RoomLine. Whom am I speaking to ?
-U: Help
-S: At this point I am trying to log you into the system. If you are
- a registered user, please tell me your name. Otherwise, you can
- say 'guest'. Whom am I speaking to ?
-U: Guest
-S: Welcome, guest user. I am a spoken dialog system that can make
- conference room reservations for you in NewellSimon and Wean Hall.
- <more instructions>
-S: So, how can I help you ?
-U: I need a room for Thrusday around noon.
-S: Okay, I have NSH4513 and WeH4623 available from 11 till late in
- the evening. Do you want any of these ?
-U: How big are they ?
-S: The newell simon one can hold 12 persons. The wean hall one is
- bigger, can hold about 25. They both have projectors and
- computers, but NSH doesn't have a network connection
-U: Okay, I'll take the newell simon one.
-S: And you need it from noon until when ?
-U: Until 1:30pm.
-S: Okay, noon to 1:30. Is it only for this Thrusday, or do you need it
- every week ?
-U: Just this thursday.
-S: Okay, so I have reserved NSH 4513 for you for Thursday March 26th,
- from 12pm until 1:30pm. Is that correct ?
-U: Yes.
-S: Is there anything else I could do for you today ?
-U: No
-S: Thank you for using roomline. Bye bye.
-U: Bye.
-
-S: Hi, welcome to Roomline. Whom am I speaking to ?
-U: Renee
-S: Hi Renee, how can I help you today
-U: Well, I need a room for Tuesday April 22nd.
-S: Around what time and for how long ?
-U: I need from 10 to 12.
-S: Okay, the only room I have free at that time on Tuesday April 22nd
- is WeH4625. Is that fine ?
-U: Yes, that's great.
-S: Okay, I made you a reservation for WeH4625 for Tuesday April 22nd
- from 10 to 12. Is there anything else I can help you today
-U: No, thanks, bye
-S: You're welcome, bye, bye.
-
-S: Hi, welcome to Roomline. Whom am I speaking to ?
-U: Renee
-S: Hi Renee, how can I help you today
-U: Well, I need a room for Tuesday April 22nd.
-S: Around what time and for how long ?
-U: I need from 10 to 12.
-S: From 9 to 12. Okay, I have 3 rooms ...
-U: No, no, I said from 10 to 12.
-S: Hmm, let me get this straight. So do you want the room starting
- at 10 ?
-U: Yes, from 10 to 12.
-S: Okay, the only room I have free at that time on Tuesday April 22nd
- is WeH4625. Is that fine ?
-U: Yes.
-S: Okay, I made you a reservation for WeH4625 for Tuesday April 22nd
- from 10 to 12. Is there anything else I can help you today ?
-U: No, thanks, bye
-S: You're welcome, bye, bye.
-
-_________________________________________________________________________
-
-What are the ingredients:
-1. GRAMMAR
-
-2. LANGUAGE MODEL
-
-3. ACOUSTIC MODELS
-
-4. BACKEND
-4.1. WEB SCRAPER FOR CORPORATETIME + QUERY MANAGER
-4.2. DATETIME
-
-5. DIALOG MANAGEMENT
-
-6. NLG
-
-7. SYNTHESIS
\ No newline at end of file
Deleted: TeamTalk/Resources/Grammar/TeamTalkTask-template.gra
===================================================================
--- TeamTalk/Resources/Grammar/TeamTalkTask-template.gra 2007-06-10 03:20:30 UTC (rev 632)
+++ TeamTalk/Resources/Grammar/TeamTalkTask-template.gra 2007-06-11 16:47:47 UTC (rev 633)
@@ -1,369 +0,0 @@
-###################################################################
-#
-# Z A P T A S K G R A M M A R
-#
-# HISTORY: -------------------------------------------------------
-#
-# [2003-03-08] (sison): started working on this
-#
-###################################################################
-
-[RobotName]
- (everyone)
-%%RobotNames%%
-;
-
-[OBJ-Robot]
- ([RobotName])
-;
-
-[HumanExploreCommand]
- (explore)
-;
-
-[HumanSearchCommand]
- (search)
-;
-
-[HumanFollowCommand]
- (*[RobotName] FOLLOW [OBJ-Robot])
-
-FOLLOW
- (join)
- (follow)
- (find)
-;
-
-[HumanPauseCommand]
- (*[RobotName] pause)
-;
-
-[HumanContinueCommand]
- (*[RobotName] continue)
-;
-
-[HumanReportCommand]
- (*[RobotName] report)
- ([RobotName])
-;
-
-[HumanLocationQuery]
- (*[RobotName] where are you)
-;
-
-[HumanHaltCommand]
- (*[RobotName] all stop)
-;
-
-[TurnDirection]
- (right *[AngularQualifier])
- (left *[AngularQualifier])
- (around)
-;
-
-[MoveDirection]
- (right *[AngularQualifier])
- (left *[AngularQualifier])
- (straight)
- (forward)
- (forwards)
- (back)
- (backward)
- (backwards)
-;
-
-[AngularQualifier]
- ([Number-180-by5] degrees)
-;
-
-[Number-180-by5]
- (five)
- (ten)
- (fifteen)
- (twenty *five)
- (thirty *five)
- (forty *five)
- (fifty *five)
- (sixty *five)
- (seventy *five)
- (eighty *five)
- (ninety *five)
- (HUNDRED)
- (HUNDRED *and five)
- (HUNDRED *and ten)
- (HUNDRED *and fifteen)
- (HUNDRED *and twenty *five)
- (HUNDRED *and thirty *five)
- (HUNDRED *and fourty *five)
- (HUNDRED *and fifty *five)
- (HUNDRED *and sixty *five)
- (HUNDRED *and seventy *five)
- (HUNDRED *and eighty)
-
-HUNDRED
- (a hundred)
- (one hundred)
-;
-
-[AbsoluteDistance]
- ([Number-20] [Units])
-;
-
-[RelativeDistance]
- ([ZapAll] *of the way)
- ([ZapHalf] *of *the way)
- ([ZapThird] of the way)
- ([ZapTwoThird] of the way)
- ([ZapOneQuarter] of the way)
- ([ZapThreeQuarter] of the way)
-;
-
-[ZapAll]
- (all)
-;
-
-[ZapHalf]
- (halfway)
- (one half)
- (a half)
- (half)
-;
-
-[ZapThird]
- (one third)
- (a third)
-;
-
-[ZapTwoThird]
- (two third)
- (two thirds)
-;
-
-[ZapOneQuarter]
- (one quarters)
- (one quarter)
- (one forth)
- (a quarters)
- (a quarter)
- (a forth)
-;
-
-
-[ZapThreeQuarter]
- (three quarter)
- (three quarters)
- (three forth)
- (three forths)
-;
-
-[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)
-;
-
-[MoveToGoal]
- (*[RobotName] MOVE *[RelativeDistance] PREP *[Side] [Goal])
- (*[RobotName] MOVE [Home])
-
-MOVE
- (move)
- (go)
- (drive)
-
-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)
-;
-
-[Xcoord]
- (*negative [Number-20])
-;
-
-[Ycoord]
- (*negative [Number-20])
-;
-
-[Units]
- (meters)
- (meter)
-# (feet)
-# (foot)
-# (yards)
-# (yard)
-;
-
-[HumanGoodbyeCommand]
- (goodbye)
- (bye bye)
- (mission complete)
- (that's it)
-;
-
-[HumanTurnCommand]
- (TURN [TurnDirection])
-
-TURN
- (turn)
- (face)
-;
-
-[Number-20]
- (zero)
- (one)
- (two)
- (three)
- (four)
- (five)
- (six)
- (seven)
- (eight)
- (nine)
- (ten)
- (eleven)
- (twelve)
- (thirteen)
- (fourteen)
- (fifteen)
- (sixteen)
- (seventeen)
- (eighteen)
- (nineteen)
- (twenty)
-;
-
-###################################################################
-# YES/NO grammar
-###################################################################
-
-[Yes]
- (YES *MOD)
- (STRONG_MOD)
- (OKAY)
- (WEAK_MOD)
-YES
- (yes)
- (yeah)
- (yep)
- (yup)
-MOD
- (STRONG_MOD)
- (WEAK_MOD)
-STRONG_MOD
- (you betcha)
-#tk hack: interferes with "go forward" (*let's go for it)
- (absolutely)
- (definitely)
- (OKAY OKAY)
-WEAK_MOD
- (why not)
- (i think so)
- (i guess so)
-OKAY
- (sure)
- (of course)
- (ok)
- (okay)
- (correct)
- (fine)
- (perfect)
- (great)
- (wonderful)
- (acceptable)
- (good *enough)
- (right)
- (alright)
- (cool)
-;
-
-[No]
- (no *MOD)
- (*no absolutely not)
- (nope)
- (nah)
- (no way)
- (*no i DONT)
- (*no i DONT think so)
- (never mind)
- (nevermind)
- (*no not really)
- (nowhere)
- (negative)
-DONT
- (don't)
- (do not)
-MOD
- (thanks)
- (thank you)
- (not really)
- (i *really don't want to)
- (it's not)
- (i'm not)
-NO
- (no)
- (not)
-GOOD
- (right)
- (correct)
- (good)
- (okay)
-;
-
-
-###################################################################
-# CANCEL grammar
-###################################################################
-
-[Cancel]
- (CANCEL *COMMAND)
-CANCEL
- (cancel)
- (quit)
-COMMAND
- (*that command)
- (that)
-;
\ No newline at end of file
Copied: TeamTalk/Resources/Grammar/TeamTalkTask.gra (from rev 632, TeamTalk/Resources/Grammar/TeamTalkTask-template.gra)
===================================================================
--- TeamTalk/Resources/Grammar/TeamTalkTask.gra (rev 0)
+++ TeamTalk/Resources/Grammar/TeamTalkTask.gra 2007-06-11 16:47:47 UTC (rev 633)
@@ -0,0 +1,368 @@
+###################################################################
+#
+# Z A P T A S K G R A M M A R
+#
+# HISTORY: -------------------------------------------------------
+#
+# [2003-03-08] (sison): started working on this
+#
+###################################################################
+
+[RobotName]
+ (everyone)
+;
+
+[OBJ-Robot]
+ ([RobotName])
+;
+
+[HumanExploreCommand]
+ (explore)
+;
+
+[HumanSearchCommand]
+ (search)
+;
+
+[HumanFollowCommand]
+ (*[RobotName] FOLLOW [OBJ-Robot])
+
+FOLLOW
+ (join)
+ (follow)
+ (find)
+;
+
+[HumanPauseCommand]
+ (*[RobotName] pause)
+;
+
+[HumanContinueCommand]
+ (*[RobotName] continue)
+;
+
+[HumanReportCommand]
+ (*[RobotName] report)
+ ([RobotName])
+;
+
+[HumanLocationQuery]
+ (*[RobotName] where are you)
+;
+
+[HumanHaltCommand]
+ (*[RobotName] all stop)
+;
+
+[TurnDirection]
+ (right *[AngularQualifier])
+ (left *[AngularQualifier])
+ (around)
+;
+
+[MoveDirection]
+ (right *[AngularQualifier])
+ (left *[AngularQualifier])
+ (straight)
+ (forward)
+ (forwards)
+ (back)
+ (backward)
+ (backwards)
+;
+
+[AngularQualifier]
+ ([Number-180-by5] degrees)
+;
+
+[Number-180-by5]
+ (five)
+ (ten)
+ (fifteen)
+ (twenty *five)
+ (thirty *five)
+ (forty *five)
+ (fifty *five)
+ (sixty *five)
+ (seventy *five)
+ (eighty *five)
+ (ninety *five)
+ (HUNDRED)
+ (HUNDRED *and five)
+ (HUNDRED *and ten)
+ (HUNDRED *and fifteen)
+ (HUNDRED *and twenty *five)
+ (HUNDRED *and thirty *five)
+ (HUNDRED *and fourty *five)
+ (HUNDRED *and fifty *five)
+ (HUNDRED *and sixty *five)
+ (HUNDRED *and seventy *five)
+ (HUNDRED *and eighty)
+
+HUNDRED
+ (a hundred)
+ (one hundred)
+;
+
+[AbsoluteDistance]
+ ([Number-20] [Units])
+;
+
+[RelativeDistance]
+ ([ZapAll] *of the way)
+ ([ZapHalf] *of *the way)
+ ([ZapThird] of the way)
+ ([ZapTwoThird] of the way)
+ ([ZapOneQuarter] of the way)
+ ([ZapThreeQuarter] of the way)
+;
+
+[ZapAll]
+ (all)
+;
+
+[ZapHalf]
+ (halfway)
+ (one half)
+ (a half)
+ (half)
+;
+
+[ZapThird]
+ (one third)
+ (a third)
+;
+
+[ZapTwoThird]
+ (two third)
+ (two thirds)
+;
+
+[ZapOneQuarter]
+ (one quarters)
+ (one quarter)
+ (one forth)
+ (a quarters)
+ (a quarter)
+ (a forth)
+;
+
+
+[ZapThreeQuarter]
+ (three quarter)
+ (three quarters)
+ (three forth)
+ (three forths)
+;
+
+[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)
+;
+
+[MoveToGoal]
+ (*[RobotName] MOVE *[RelativeDistance] PREP *[Side] [Goal])
+ (*[RobotName] MOVE [Home])
+
+MOVE
+ (move)
+ (go)
+ (drive)
+
+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)
+;
+
+[Xcoord]
+ (*negative [Number-20])
+;
+
+[Ycoord]
+ (*negative [Number-20])
+;
+
+[Units]
+ (meters)
+ (meter)
+# (feet)
+# (foot)
+# (yards)
+# (yard)
+;
+
+[HumanGoodbyeCommand]
+ (goodbye)
+ (bye bye)
+ (mission complete)
+ (that's it)
+;
+
+[HumanTurnCommand]
+ (TURN [TurnDirection])
+
+TURN
+ (turn)
+ (face)
+;
+
+[Number-20]
+ (zero)
+ (one)
+ (two)
+ (three)
+ (four)
+ (five)
+ (six)
+ (seven)
+ (eight)
+ (nine)
+ (ten)
+ (eleven)
+ (twelve)
+ (thirteen)
+ (fourteen)
+ (fifteen)
+ (sixteen)
+ (seventeen)
+ (eighteen)
+ (nineteen)
+ (twenty)
+;
+
+###################################################################
+# YES/NO grammar
+###################################################################
+
+[Yes]
+ (YES *MOD)
+ (STRONG_MOD)
+ (OKAY)
+ (WEAK_MOD)
+YES
+ (yes)
+ (yeah)
+ (yep)
+ (yup)
+MOD
+ (STRONG_MOD)
+ (WEAK_MOD)
+STRONG_MOD
+ (you betcha)
+#tk hack: interferes with "go forward" (*let's go for it)
+ (absolutely)
+ (definitely)
+ (OKAY OKAY)
+WEAK_MOD
+ (why not)
+ (i think so)
+ (i guess so)
+OKAY
+ (sure)
+ (of course)
+ (ok)
+ (okay)
+ (correct)
+ (fine)
+ (perfect)
+ (great)
+ (wonderful)
+ (acceptable)
+ (good *enough)
+ (right)
+ (alright)
+ (cool)
+;
+
+[No]
+ (no *MOD)
+ (*no absolutely not)
+ (nope)
+ (nah)
+ (no way)
+ (*no i DONT)
+ (*no i DONT think so)
+ (never mind)
+ (nevermind)
+ (*no not really)
+ (nowhere)
+ (negative)
+DONT
+ (don't)
+ (do not)
+MOD
+ (thanks)
+ (thank you)
+ (not really)
+ (i *really don't want to)
+ (it's not)
+ (i'm not)
+NO
+ (no)
+ (not)
+GOOD
+ (right)
+ (correct)
+ (good)
+ (okay)
+;
+
+
+###################################################################
+# CANCEL grammar
+###################################################################
+
+[Cancel]
+ (CANCEL *COMMAND)
+CANCEL
+ (cancel)
+ (quit)
+COMMAND
+ (*that command)
+ (that)
+;
\ No newline at end of file
Deleted: TeamTalk/Resources/Grammar/cmp.bat
===================================================================
--- TeamTalk/Resources/Grammar/cmp.bat 2007-06-10 03:20:30 UTC (rev 632)
+++ TeamTalk/Resources/Grammar/cmp.bat 2007-06-11 16:47:47 UTC (rev 633)
@@ -1,7 +0,0 @@
-REM copy Generic.gra + TeamTalkTask.gra TeamTalk.gra
-copy TeamTalkTask.gra TeamTalk.gra
-REM copy Generic.forms + TeamTalkTask.forms forms
-copy TeamTalkTask.forms forms
-perl mk_nets2.pl TeamTalk.gra
-compile -g . -f TeamTalk > log
-concept_leaf -grammar TeamTalk.net
Added: TeamTalk/Resources/Grammar/cmp.pl
===================================================================
--- TeamTalk/Resources/Grammar/cmp.pl (rev 0)
+++ TeamTalk/Resources/Grammar/cmp.pl 2007-06-11 16:47:47 UTC (rev 633)
@@ -0,0 +1,33 @@
+#!/usr/local/bin/perl
+
+use strict;
+
+open(TTGRA, ">TeamTalk.gra");
+open(NETS, ">nets");
+open(TTTASKGRA, "TeamTalkTask.gra");
+while(<TTTASKGRA>) {
+ print TTGRA $_;
+ next unless (/^\[([^\]]+)\]/);
+ print NETS "$1\n";
+ next unless $1 eq 'RobotName' && -e 'TeamTalkRobots';
+ open(TTROBOTS, "TeamTalkRobots");
+ for my $robot (grep /\S/, <TTROBOTS>) {
+ chop $robot;
+ $robot =~ s/\r$//;
+ print TTGRA "\t($robot)\n";
+ }
+ close TTROBOTS;
+}
+
+open(FORMS, ">forms");
+open(TTFORMS, "TeamTalkTask.forms");
+print FORMS <TTFORMS>;
+close TTFORMS; close FORMS;
+
+open(COMPILE, "compile -g . -f TeamTalk|");
+open(LOG, ">log");
+print LOG <COMPILE>;
+close COMPILE; close LOG;
+
+system("concept_leaf -grammar TeamTalk.net");
+1;
Deleted: TeamTalk/Resources/Grammar/generate_random_samples
===================================================================
--- TeamTalk/Resources/Grammar/generate_random_samples 2007-06-10 03:20:30 UTC (rev 632)
+++ TeamTalk/Resources/Grammar/generate_random_samples 2007-06-11 16:47:47 UTC (rev 633)
@@ -1,1039 +0,0 @@
-#!/usr/local/bin/perl5
-# This line tells emacs, that this is a -*-Perl-*- program
-
-$licence = <<LICENCE;
-
- Copyright (C) 1996 Interactive System Labs and Klaus Ries
-
-LICENCE
-
-$n_default=10;
-$break_prob_default = 0;
-$leave_out_prob_default = 0.1;
-$repeat_prob_default = 0.25;
-$maxtopnets_default = 2;
-$nexttopnetprob_default = 1;
-
-$n=$n_default;
-$break_prob = $break_prob_default;
-$leave_out_prob = $leave_out_prob_default;
-$repeat_prob = $repeat_prob_default;
-$nexttopnetprob = $nexttopnetprob_default;
-$maxtopnets = $maxtopnets_default;
-
-
-while($ARGV[0] =~ /^-.*$/) { # PROCESS FLAGS
- $_ = shift;
- if($_ eq "-h") {
- $help++;
- next;
- }
- if($_ eq "-n") {
- $n=shift;
- next;
- }
- if($_ eq "-grammar") {
- $grammar_file = shift;
- next;
- }
- if($_ eq "-maxtopnets") {
- $maxtopnets = shift;
- next;
- }
- if($_ eq "-nexttopnetprob") {
- $nexttopnetprob = shift;
- next;
- }
- if($_ eq "-leave_out") {
- $leave_out_prob=shift;
- next;
- }
- if($_ eq "-repeat") {
- $repeat_prob=shift;
- next;
- }
- if($_ eq "-show_break") {
- $show_break++;
- next;
- }
- if($_ eq "-d") {
- $dir=shift;
- next;
- }
- if($_ eq "-forms") {
- $forms=shift;
- next;
- }
- if($_ eq "-warn") {
- $warn++;
- next;
- }
- if($_ eq "-capital") {
- $capital++;
- next;
- }
- if($_ eq "-dictionary") {
- $dictionary++;
- next;
- }
- if($_ eq "-makedict") {
- $makedict++;
- next;
- }
- if($_ eq "-unkdict") {
- $unkdict++;
- next;
- }
- if($_ eq "-vocabulary") {
- $vocabulary++;
- next;
- }
- if($_ eq "-class") {
- $classes++;
- next;
- }
- if($_ eq "-noclass") {
- $noclasses++;
- next;
- }
- if($_ eq "-novariants") {
- $novariants++;
- next;
- }
- if($_ eq "-iclass") {
- $inverse_map++;
- next;
- }
- if($_ eq "-modifyLM") {
- $modify++;
- next;
- }
- if($_ eq "-clausi") {
- $clausi++;
- next;
- }
- die "Unrecognized command line option $_\nUse generate_random_samples -h for help\n";
-}
-
-help() if($help);
-
-if(defined $dir) {
- $currdir=$ENV{PWD};
- die "Cannot change to $dir\n" unless chdir $dir;
- warn "Changed to $dir\n";
-}
-
-
-# First load the forms of that grammer:
-
-$FORMS = "forms";
-$FORMS .= ".$forms" if defined $forms;
-
-open FORMS;
-
-while(<FORMS>) {
-
- $random_perm++ if /%%randomperm%%/;
-
- $prob=get_prob();
-
- if(s/^\s*FUNCTION:\s*(\S+)//) {
- my @F = ();
- my @G = ();
- $name=$1;
- print STDERR "The name of the function is >>$name<<\n";
- undef $nets;
- push(@top_level,$name);
- push(@top_level_prob,$prob);
- push(@top_level_slots,\@F);
- push(@top_level_probs,\@G);
- push(@top_level_perm,$random_perm);
- undef $random_perm;
- $top_level{$name}++;
- }
- next unless defined $name;
-
- if(/^\s*NETS:/) {
- $nets++; next;
- }
- elsif($nets) {
- 1;
- }
- else {
- next;
- }
-
- if(s/^(\t|\s{2,})(\S+)/$2/) {
- $entry=$2;
- if(defined $top_level{$name,$entry}) {
- warn "Multiple entry for $entry in function $name\n" ;
- next;
- }
- push(@{$top_level_slots[$#top_level_slots]},$entry);
- push(@{$top_level_probs[$#top_level_probs]},$prob);
- $top_level{$name,$entry}++;
- $public{$entry}++;
- }
-}
-close FORMS;
-
-normalize_random_entry(\@top_level_prob);
-
-foreach(@top_level_prob) {
- normalize_random_entry($_);
-}
-
-
-die "No top-level slots" unless () ne keys %top_level;
-
-# Now load the nets themselves
-
-$NETS = "nets";
-
-open NETS;
-while(<NETS>) {
- next unless /\S/;
- chomp;
- s/\s+$//;
-
- if(defined $nets{$_} || defined $nets{"[$_]"}) {
- warn "Multiple entry for >>$_<< in nets\n" ;
- next;
- }
- $nets{$_}++;
-
- if(/[^A-Za-z]/) {
- $_="[$_]";
- }
- $public{$_}++;
-}
-close NETS;
-
-$nets{"noises"}++ if -r "noises.gra";
-
- at noise=("SegmentNoise","BeginNoise","EndNoise","BreakNoise","RandomNoise");
-
-if($nets{"noises"}) {
- foreach(@noise) {
- $public{$_}++;
- }
-}
-
-# Next thing: Load all the grammars
-
-# MODIFIED BY ANTOINE (hacked grammar file name)
-# changed back by dbohus, so that it's a parameter in the command line
-load_grammar_file($grammar_file);
-
-foreach(keys %nets) {
- print STDERR "Loading grammar file $_ ............\r";
-
- $NAME=$_;
- load_grammar_file("$NAME.gra");
-}
-
-if($nets{"noises"}) {
- foreach(@noise) {
- undef $public{$_} unless defined $rules{$_};
- }
-}
-
-chdir $currdir if defined $currdir;
-print STDERR "Finished loading grammar file \n";
-
-
-# Next thing: Generate sentences
-
-srand;
-
-check_grammar() if $warn;
-
-
-if($dictionary || $vocabulary || $makedict || $unkdict) { # Print all the defined dictionary/vocabulary entries
- foreach $slot_ref (@top_level_slots) {
- foreach(@{$slot_ref}) {
- $slots{$_}++;
- }
- }
- @netname = keys %slots;
- foreach(@noise) {
- push(@netname,$_) if defined $public{$_};
- }
-
- build_reachable_dictionary();
-
-
- open(OUT,"| sort -u | perl -pe 's/\\(0\\)\\}/\\}/;'");
- if($vocabulary) {
- foreach(keys %reachable_t) {
- print OUT "$_\n";
- }
- print OUT "<s>\n</s>\n";
- }
- elsif($dictionary) {
- foreach(keys %reachable_t) {
- if($class{$_}) {
- $_=join("\n",print_net_all($_));
- }
- print OUT "$_\n";
- }
- }
- else { # Makedict !!
- # or unkdict !!
- # Calculate all words that we need from the dictionary
- # Assign an empty list to all of them to get
- # the effective entries
-
- foreach(keys %reachable_t) {
- next if $class{$_};
- if(/\266/) { # In case we have entered that phrase to
- # the dictionary
- next if defined $vocab{$_};
- my @F=();
- $vocab{$_}=\@F;
- }
- if(/\266S$/) {
- my $word2=$_;
- $word2=~s/\266S$/\'S/;
- next if defined $vocab{$word2};
- my @F=();
- $vocab{$word2}=\@F;
- }
- foreach(split(/\266/,$_)) {
- next if defined $vocab{$_};
- my @F=();
- $vocab{$_}=\@F;
- }
- }
- foreach(keys %class) {
- next unless $reachable{$_};
- foreach(print_net_all($_)) {
- ($word,$class)=split(/:/,$_,2);
- if($word=~/\266/) { # In case we have entered that phrase to
- # the dictionary
- next if defined $vocab{$word};
- my @F=();
- $vocab{$word}=\@F;
- }
- if($word=~/\266S$/) {
- my $word2=$word;
- $word2=~s/\266S$/\'S/;
- next if defined $vocab{$word2};
- my @F=();
- $vocab{$word2}=\@F;
- }
- foreach(split(/\266/,$word)) {
- next if defined $vocab{$_};
- my @F=();
- $vocab{$_}=\@F;
- }
- }
- }
-
- # Now selectively read the real dictionary from stdin/commandline
- # Also read pronounciation variants
-
- while(<>) {
- s/^\{?\s*([^\s\}\(]+)(\([^\)]+\))?\s*\}?\s+//;
- $word=$1;
- $ref = $vocab{$word};
- s/^\s*\{?\s*//;
- s/\s*\}?\s*$//;
- foreach $phonem (split) {
- next unless $phonem=~/\S/ && $phonem=~/^[a-z]/i;
- $phonem{$phonem}++;
- }
- next unless defined $ref;
- next if $novariants && @{$ref}>0;
- $pron=$_;
- push(@{$ref},$pron) unless grep($_ eq $pron,@{$ref})>0;
- }
-
-
- if($unkdict) {
- while(($word,$pron) = each %vocab) {
- next if $word=~/\266/;
- print OUT "$word\n" unless @{$pron} ;
- }
- }
- else {
- @phonem = sort { $phonem{$a} <=> $phonem{$b} }
- grep($phonem{$_}>2 && $_ ne "SIL",keys %phonem);
-
- # Pick a very seldom phonem for the words that are artifically in the dictionary
- # to keep the vocabulary module happy
- # These are specifically the class symbols
-
- $badphonem=$phonem[0];
- $badphonem.=" $badphonem";$badphonem.=" $badphonem";
- $badphonem.=" $badphonem";$badphonem.=" $badphonem";
-
- foreach(keys %reachable_t) {
- next if $class{$_};
- print OUT lookup_pronounciation($_,split(/\266/))
- }
- foreach(keys %class) {
- next unless $reachable{$_};
- print OUT "\{$_\} \{$badphonem\}\n";
- foreach $symbol (print_net_all($_)) {
- ($word,$class)=split(/:/,$symbol,2);
- print OUT lookup_pronounciation($symbol,split(/\266/,$word));
- }
- }
- print OUT "{\$} {SIL}\n{(} {SIL}\n{)} {SIL}\n";
- }
- close OUT;
- }
-}
-elsif($classes) {
- foreach $class (keys %class) {
- $_=join(" ",$class,print_net_all($class));
- print "$_\n";
- }
-}
-elsif($inverse_map) {
- foreach $class (keys %class) {
- foreach $classword (print_net_all($class)) {
- ($word)=split(/:/,$classword);
- $imap=$inversemap{$word};
- if(defined $imap) {
- push(@{$imap},$classword);
- }
- else {
- my(@F)=($classword);
- $inversemap{$word}=\@F;
- }
- }
- }
- while(($word,$imap)=each %inversemap) {
- print join("\#",@{$imap})." $word\n";
- }
-}
-elsif($modify) {
-
- while(<>) {
- if(/^\\subsmodel:/) {
- $skipsmodel++;
- last;
- }
- print;
- }
- if($skipsmodel) {
- while(<>) {
- if(/^\\end\\/) {
- last;
- }
- }
- print while <>;
- }
-
- print "\\subsmodel:\n";
- foreach $class (sort keys %class) {
- print "-99.9 $class $class\n";
- @classmembers = print_net_all($class);
- $classpenalty = -log(scalar(@classmembers))/log(10);
- foreach $classmember (sort @classmembers) {
- $_="$classpenalty $classmember $class\n";
- print;
- }
- }
- print "\\end\\\n";
-}
-else { # Print random sentences
- foreach($i=0;$i<$n;$i++) { # Select a top-level frame and generate a sentence for it
- print_random_sentence(select_random_entry(\@top_level_prob,"FORM"));
- }
-}
-
-
-sub print_random_sentence {
-
- my($select) = @_;
- my($select_local,$parse,$parse_local);
-
-# print "$top_level[$select]:";
-
- if($top_level_perm[$select]) {
- begin_noise();
- $break=1;
- while($break) {
- $break=0;
- print_net_random(${$top_level_slots[$select]}[$select_local]);
- if($break) {
- break_noise();
- }
- else {
- segment_noise();
- }
- }
- end_noise();
- }
- else {
- begin_noise();
- $counter = 0;
- foreach $select_local (@{$top_level_slots[$select]}) {
- $counter++;
- $break=1;
- while($break) {
- $break=0;
- print_net_random($select_local);
- if($break) {
- break_noise();
- }
- else {
- segment_noise();
- }
- }
- if((rand() > $nexttopnetprob) || ($counter >= $maxtopnets)) {
- last;
- }
- }
- end_noise();
- }
- print "\n";
-}
-
-sub begin_noise {
- print_net_random("BeginNoise") if defined $public{"BeginNoise"};
-}
-
-
-sub end_noise {
- print_net_random("EndNoise") if defined $public{"EndNoise"};
-}
-
-
-sub segment_noise {
- print_net_random("SegmentNoise") if defined $public{"SegmentNoise"};
-}
-
-sub break_noise {
- print_net_random("BreakNoise") if defined $public{"BreakNoise"};
-}
-
-sub random_noise {
- print_net_random("RandomNoise") if defined $public{"RandomNoise"};
-}
-
-sub random_break {
- if(1-$break_prob<rand()) {
- $break++;
- print " **<** " if $show_break;
- }
-}
-
-
-sub select_random_entry {
- my($array,$name) = @_;
- my $prob=0;
- my $random = rand();
- my $return=0;
- my $i=0;
-
- foreach(@$array) {
- $prob+=$_;
- return $i if $random<$prob;
- $i++;
- }
- die "$name not a probability distribution: ".join(" ",@{$array})."\n";
-}
-
-sub normalize_random_entry {
- local($array) = @_;
- my $i;
- my $prob = 0;
- my $zero = 0;
-
- if(@{$array}==1) {
- $$array[0]=1;
- return;
- }
-
- for( $i=0; $i<=$#$array; $i++ ) {
- $prob+=$$array[$i];
- if($$array[$i] == 0) {
- $zero++;
- }
- }
- die "Not a probability distribution $prob>1\n" if $prob>1;
-
- if($zero>0) {
- $prob = (1-$prob)/$zero;
- for( $i=0; $i<=$#$array; $i++ ) {
- $$array[$i] = $prob if $$array[$i]==0;
- }
- }
-}
-
-sub print_net_random {
-
- my($netname) = @_;
- my($repeat,$type,$body);
-
- my($text) = "";
-
- unless(defined $rules{$netname}) {
- warn "Rule for $netname not defined\n" if $warn;
- return "";
- }
-
- my($rule_ref) = ${$rules{$netname}}[select_random_entry($rules_prob{$netname},$netname)];
-
- foreach(@$rule_ref) {
- ($repeat,$type,$body) = split(/,/,$_);
-
- while(1) {
- if($repeat=~s/\*//g) {
- last if rand()<$leave_out_prob;
- $repeat="1" unless $repeat=~/\S/;
- }
- if($type eq "T" || $class{$body}) {
- if($clausi) {
- print "$body\n"; random_noise();
- }
- else {
- print "$body "; random_noise();
- }
- }
- else {
- print_net_random($body);
- random_break();
- }
- return if $break;
- last if $repeat eq "1";
- last unless rand()<$repeat_prob;
- }
- }
-}
-
-
-
-sub print_net_all {
- local($global_netname) = @_;
- local(%already_visited);
-
- my(@return) = print_net_all2($global_netname);
- my($ret_length)=scalar(@return);
- @return=grep(/\S/, at return);
- warn "$global_netname could expand to empty, ignored\n"
- unless @return==$ret_length;
- @return=grep(($_.=":$global_netname") || 1, at return);
- return @return;
-}
-
-
-sub print_net_all2 {
-
- my($netname) = shift @_;
- my($repeat,$type,$body,$ruleref);
- my(@returnarray)=();
-
- unless(defined $rules{$netname}) {
- warn "Rule for $netname not defined\n" if $warn;
- return ();
- }
-
- return @_ if $already_visited{$netname}>1;
- $already_visited{$netname}++;
- foreach $ruleref (@{$rules{$netname}}) {
- my(@rulereturn)=@_;
- foreach(@{$ruleref}) {
- ($repeat,$type,$body) = split(/,/,$_);
-
- my(@localrulereturn)=();
-
- if($repeat eq "*") {
- @localrulereturn=@rulereturn;
- @localrulereturn=("") unless @localrulereturn>0;
- }
- warn "Rule for $netname contains repetition $repeat specification -- ignored"
- unless $repeat eq "1" || $repeat eq "*";
-
- if($type eq "T") {
- $body = "+$body+" if $body =~ s/^&//;
- if(@rulereturn) {
- for($i=0;$i<=$#rulereturn;$i++) {
- if($rulereturn[$i]=~/\S/) {
- $rulereturn[$i].="\266$body";
- } else {
- $rulereturn[$i]="$body";
- }
- }
- }
- else {
- @rulereturn=($body);
- }
- }
- else {
- @rulereturn=print_net_all2($body, at rulereturn);
- }
- push(@rulereturn, at localrulereturn);
- }
- push(@returnarray, at rulereturn);
- }
- $already_visited{$netname}--;
- return @returnarray;
-}
-
-
-sub build_reachable_dictionary {
-
- my($netname);
- my($repeat,$type,$body,$rule_ref);
-
- my($text) = "";
-
- while(@netname) {
- $netname = shift @netname;
-
- if($class{$netname}) {
- $reachable_t{$netname}++;
- $reachable{$netname}++;
- next;
- }
-
- unless(defined $rules{$netname}) {
- warn "Rule for $netname not defined in build_reachable_dictionary\n" if $warn;
- return "";
- }
-
- foreach $rule_ref (@{$rules{$netname}}) {
- foreach(@{$rule_ref}) {
- ($repeat,$type,$body) = split(/,/,$_);
- if($type eq "T") {
- $reachable_t{$body}++;
- }
- else {
- unless(exists $reachable{$body}) {
- push(@netname,$body);
- $reachable{$body}++;
- }
- }
- }
- }
- }
-}
-
-
-sub check_grammar {
-
- while(($definition) = each %public) {
- warn "Net rule $definition not defined\n" unless defined $rules{$definition};
- }
- while(($definition,$count) = each %definition) {
- for($i=1;$i<=$count;$i++) {
- warn "$definition:$count not defined" unless defined $rules{"$definition:$count"};
- }
- }
-}
-
-
-sub get_prob {
-
- if(s/[\#;]([\s\S]+)//) {
- my $comment=$1;
-
- if($comment=~/%%CLASS%%/) {
- $class=1;
- } else {
- $class=0;
- }
-
- return $1 if $comment=~/%%(\S+)%%/;
- }
- $class=0;
- return 0;
-}
-
-
-sub load_grammar_file {
- local($GRAMMAR_FILE) = @_;
- local($concept, at rules, at rules_prob);
- local(*GRAMMAR);
-
-# print STDERR "Reading $GRAMMAR_FILE of $NAME\n";
-
- $concept = "";
- @rules = ();
- $conceptclass=0;
-
- open(GRAMMAR,$GRAMMAR_FILE);
- while(<GRAMMAR>) {
- if(/^\#include\s+(\S+)/) {
- flush_concept();
- $conceptclass=0;
- load_grammar_file($1,$NAME);
- }
- else {
- # Get rid of comments and empty lines
-
- $prob=get_prob(); next unless /\S/;
-
- # Classify line
- if(/^(\S+)/) { # It's a concept
- $new_concept=$1;
- flush_concept();
- $conceptclass=$class;
- $concept=$new_concept;
- }
- else {
- die "No concept defined" unless $concept=~/\S/;
- die "No begin-parenthesis in $concept rules $_\n" unless s/^\s+\(\s*//;
- die "No end-parenthesis in $concept rules $_\n" unless s/\s*\)\s*$//;
-
- push(@rules,$_);
- push(@rules_prob,$prob);
- }
- }
- }
- flush_concept();
- close GRAMMAR;
-}
-
-
-sub select_random_array {
- local($array_ref) = $_[0];;
-
- return @$array_ref[int(rand(scalar(@$array_ref)))];
-}
-
-
-sub flush_concept {
-
- # Determine the symbol-table-entry for the concept defined
- # If it is a top-level entry, it is globally visible.
- # Otherwise, it is only local and may be multiple definded and
- # overwritten
-
- return unless $concept=~/\S/;
-
- if($public{$concept}) {
- $real_name=$concept;
- }
- else {
- $definition{$NAME,$concept};
- $real_name="$NAME:$concept:".($definition{"$NAME:$concept"}+1);
- }
-
- die "Multiple definition of $real_name\n" if defined $rules{$real_name};
-
-
- my @new_rules = ();
-
- foreach(@rules) {
- my @rule = ();
- foreach $body (split) {
- $repeat = "1";
- $repeat = $1 if $body=~s/^([\+\*]+)//;
- $body =~ s/^\s+//; $body =~ s/\s+$//;
- if( ($body=~/^[^A-Z_\-]/) && !($body =~ /^\[.*\]$/)) {
- $type="T";
- $body=~s/\+/'/g; # '
- $body=~tr/a-z/A-Z/ if $capital;
- $body = "+$body+" if $body =~ s/^&//;
- $dictionary{$body}++;
- }
- else {
- $type="N";
-
- unless($public{$body}) {
- $body="$NAME:$body:".($definition{"$NAME:$body"}+1);
- }
- }
- push(@rule,"$repeat,$type,$body");
- }
-
- push(@new_rules,\@rule);
- }
-
- $rules{$real_name}=\@new_rules;
-
- my @new_rules_prob = @rules_prob;
- normalize_random_entry(\@new_rules_prob);
- $rules_prob{$real_name}=\@new_rules_prob;
-
-
- unless($public{$concept}) {
- $definition{"$NAME:$concept"}++;
- }
-
- @rules = ();
- @rules_prob = ();
- $class{$real_name}++ if $conceptclass && !$noclasses;
-
- $concept="";
-
-}
-
-sub lookup_pronounciation {
-
- local($word) = shift @_;
-
- local($error)="";
-
- my(@pron);
- my($pronword)=join("\266", at _);
-
- if(defined $vocab{join("\266", at _)} && @{$vocab{join("\266", at _)}}>0) {
- @pron = allchunk(join("\266", at _));
- }
- elsif(($pronword=~s/\266S$/\'S/) && (defined $vocab{$pronword}) && @{$vocab{$pronword}}>0) {
- @pron = allchunk($pronword);
- }
- else {
- @pron = allchunk(@_);
- }
- return $error if $error=~/\S/; # Error case
- my($ret) = "{$word(0)} {$pron[0]}\n";
- for($i=1;$i<=$#pron;$i++) {
- $ret .= "{$word(".($i+1).")} {$pron[$i]}\n";
- }
- return $ret;
-}
-
-sub allchunk {
- my $prefix = shift @_;
- my $dictref = $vocab{$prefix};
- my @ret=();
-
- unless((defined $dictref) && (@{$dictref}>0)) {
- $error .= "ERROR: Not all subwords ($prefix) known for $word\n";
- allchunk(@_) unless @_==0;
-
- return ();
- }
-
- return @{$dictref} if @_==0;
-
- my($suff,$pref);
-
- foreach $suff (allchunk(@_)) {
- foreach $pref (@{$dictref}) {
- push(@ret,"$pref $suff");
- }
- }
- return @ret;
-}
-
-
-
-
-
-sub help {
- print <<EOT;
-generate_random_samples -h -n N -break prob -show_break -d dir -forms ext -noclass -warn -capital
- -clausi -repeat prob -leave_out prob -vocabulary -class -iclass
- -dictionary -modifyLM [LanguageModel]
-
-
-Generates random sentences from a PHOENIX grammar that is in the
-current directory as if it were a stochastic context free grammmar.
-
-
--h -- print this help
--n N -- print N random sentences ( default $n_default )
--grammar_file file -- specifies the grammar file to be used
--maxtopnets M -- specifies the maximum number of top nets per sentence (default $maxtopnets_default)
--nexttopnetprob p -- specifies the probability for generating another top net
- basically the generation process adds another top net
- according to this probability (default $nexttopnetprob_default )
--break prob -- probability of a sentence break ( default $break_prob_default )
--show_break -- visualizes the occurence of breaks for debugging
--d dir -- change to directory dir as the PHOENIX grammar dir
--forms ext -- use forms.ext instead of forms to generate from
--noclass -- don\'t use classes when generating text, which is more human-readable
--warn -- only test the grammar
--capital -- capitalize all words
--clausi -- use special output format
--repeat prob -- repetition probability ( default $repeat_prob_default )
--leave_out prob-- leaving out an optional item probability ( default $leave_out_prob_default )
--vocabulary -- print the vocabulary used in the grammar usable for the LM
--class -- print the classes used
--iclass -- print the inverse classes used
--dictionary -- only print all the words in the grammar for pronounciation
- dictionary construction
--modifyLM -- takes an LM from stdin or from files after the options
- (possibly with old classes, these will be eliminated)
- and adds classes according to the specification by the grammar
--makedict -- takes a dictionary from stdin or from files after the options
- and generates a pronounciation dictionary
--unkdict -- takes a dictionary from stdin or from files after the options
- and generates a list of unknown words related to that dictionary
- The assumtion is, that all word strings are comosed into subwords
-
-Written by Klaus Ries <ries\@cs.cmu.edu> <kries\@ira.uka.de>
-Copyright (C) 1996,1997 Interactive System Labs and Klaus Ries
-
-
-Detailed description:
-
-All productions are assumed to be equally likely, unless one specifies
-probabilities after some of them ( the remain probability mass is
-distributed over the other prodcuctions ) in the form %%0.5%% ,
-which is interpreted as a comment by PHOENIX.
-A network can have the specification %%CLASS%% in a comment like in
-
-[townname_l] # %%CLASS%%
- ( split )
- ( bihac )
- (banja-luka)
- (sarajevo) # %%0.9%% since we are always talk about it
- (tuzla)
- (drvar)
-
-Elements within one class are assumed to be equiprobable.
-The specification of \"+\" is ignored and recursions are broken after
-the second visit of a net.
-
-The probability for leaving out an optional event is $leave_out_prob,
-the probability for repeating an repeatable event is $repeat_prob.
-One can either change these probabilies in the code or can rewrite the
-grammar such that one can specify them with corresponding rules.
-
-The generation of noises is possible if a file "noises.gra" is placed in
-same directory with the other grammar files, not all slots have to be present.
-The file "noises.gra" should look like
-______________________________________
-
-
-# &garbage is expanded to +garbage+ by definition, since "+" at
-# the beginning of a tokebn always means repetition
-BeginNoise # called before every utterance
- ( ) # %%0.6%%
- ( &garbage ) # %%0.25%%
- ( &garbage &garbage )
- ( &garbage &garbage &garbage )
-
-EndNoise # called after every utterance
- ( ) # %%0.8%%
- ( &garbage ) # %%0.15%%
- ( &garbage &garbage )
- ( &garbage &garbage &garbage )
-
-SegmentNoise # called between slots in the forms-file
- ( ) # %%0.97%%
- ( &garbage ) # %%0.015%%
- ( &garbage &garbage ) # %%0.01%%
- ( &garbage &garbage &garbage )
-
-BreakNoise # called after a break occured instead of SegmentNoise
- ( ) # %%0.3%%
- ( &garbage ) # %%0.6%%
- ( &garbage &garbage )
-
-RandomNoise # Called after every word
- ( ) # %%0.99%%
- ( &garbage ) # %%0.008%%
- ( &garbage &garbage )
-______________________________________
-
-A break is a reset of a slot that is entered in the forms file
-and simulates restarts resp. corrections.
-It may occur at every word and a probabilty for this event can be specified.
-Since it is usually marked by discourse markers a separate noise slot is defined for
-this event.
-
-
-EOT
- exit(0);
-}
Deleted: TeamTalk/Resources/Grammar/grammar.words
===================================================================
--- TeamTalk/Resources/Grammar/grammar.words 2007-06-10 03:20:30 UTC (rev 632)
+++ TeamTalk/Resources/Grammar/grammar.words 2007-06-11 16:47:47 UTC (rev 633)
@@ -1,571 +0,0 @@
-A
-I
-M
-P
-I'D
-I'LL
-I'M
-O'CLOCK
-BACK
-CAN
-CATCH
-DAY
-DATE
-EACH
-HAVE
-HAD
-HAPPENING
-HANG
-LATER
-MAIN
-NAH
-LAST
-PARDON
-PAUSE
-DAILY
-SAID
-TAKE
-SAY
-SAME
-WAS
-WANT
-WANNA
-WANTED
-WAY
-DAILIES
-DAYS
-DATES
-EASTER
-HALLOWEEN
-LABOR
-PATRICK'S
-VALENTINE
-VALENTINE'S
-NATIONS
-MARTIN
-FATHERS'
-PARENT'S
-EARLIER
-JANUARY
-MARCH
-MAY
-PAST
-HALF
-SATURDAY
-SATURDAYS
-SATURDAY'S
-EARLY
-PART
-LATE
-NAME
-DAN
-HARRIS
-RAUX
-LACKING
-MARKER
-MACHINE
-JACK
-LARGE
-LARGER
-LARGEST
-HALL
-MAKE
-CARE
-CANCEL
-HAS
-MANY
-CAPACITY
-TALKING
-MATTER
-SATISFIED
-'BOUT
-ABOUT
-ABORT
-ABSOLUTELY
-ACTIVITY
-ACCEPTABLE
-ACCORDING
-ACCESS
-ACCOMODATE
-OCTOBER
-SCRATCH
-SCREEN
-SCREENS
-BELIEVE
-BEG
-BEGINNING
-BE
-BETCHA
-GET
-HELLO
-HELP
-HEAR
-DEFINITELY
-LET'S
-LET
-NEED
-ME
-MENU
-NEITHER
-REPEAT
-SERVICE
-SESSION
-SECOND
-VERY
-WE
-WELCOME
-RESUME
-RESTART
-RESET
-WERE
-SEE
-YES
-YEAH
-YEP
-PERFECT
-NEVER
-NEVERMIND
-REALLY
-NEGATIVE
-TEN
-SEVENTEEN
-SEVENTY
-ZERO'S
-SEVEN'S
-SEVENTH
-ZERO
-SEVEN
-YEAR
-WEEK
-NEXT
-NEW
-YEAR'S
-YEARS
-MEMORIAL
-VETERANS
-WEEKS
-BEFORE
-BETWEEN
-BEGIN
-BEGINS
-WE'D
-TENTH
-SEVENTEENTH
-FEBRUARY
-SEPTEMBER
-DECEMBER
-NEAR
-NEARER
-NEAREST
-WEDNESDAY
-WEDNESDAYS
-WEDNESDAY'S
-WEEKEND
-WEEKENDS
-WEEKDAY
-WEEKDAYS
-YESTERDAY
-YESTERDAY'S
-REGARDLESS
-REAL
-PERIOD
-DEVICE
-DEVICES
-NETWORKING
-NET
-NETWORK
-NETWORKED
-LEAST
-SEAT
-PEOPLE
-PERSONS
-NEWELL
-WEAN
-RESERVE
-RESERVATION
-SEMINAR
-TELL
-SET
-DELETE
-SEATING
-MEAN
-DETAILS
-AFTERNOON
-AFTER
-AFTERWARDS
-AFTERNOONS
-OF
-AGAIN
-AGO
-CHRISTMAS
-CHRIS
-CHOICES
-CHARACTERISTICS
-CHOICE
-OH'S
-OH
-SHOULD
-THERE
-THANKS
-THANK
-THIS
-THAT
-THAT'S
-THAT'LL
-THAT'D
-THE
-THINK
-WHAT
-WHAT'D
-SHORT
-WHILE
-WHERE
-WHAT'S
-THEM
-THESE
-THOSE
-WHY
-THOUSAND
-THIRTEEN
-THIRTY
-THREE'S
-THREE
-THIRD
-THANKSGIVING
-THIRTIETH
-THIRTEENTH
-SHORTLY
-THAN
-THURSDAY
-THURSDAYS
-THURSDAY'S
-WHOLE
-THOMAS
-WHITEBOARD
-WHITEBOARDS
-WHICH
-WHICHEVER
-THEY
-BIG
-BIGGER
-DID
-DIDN'T
-DIALOG
-GIVE
-HI
-DIALOGUE
-FINE
-FIFTEEN
-LIKE
-LITTLE
-NIGHT
-MIND
-EIGHTEEN
-NINETEEN
-RIGHT
-SIXTEEN
-TIPS
-FIFTY
-SIXTY
-WILL
-EIGHTY
-NINETY
-FIVE'S
-SIX'S
-EIGHT'S
-NINE'S
-SIXTH
-EIGHTH
-NINTH
-FIVE
-SIX
-EIGHT
-NINE
-TIME
-FIRST
-FIFTH
-KING
-TIL
-TIMES
-FIFTEENTH
-SIXTEENTH
-EIGHTEENTH
-NINETEENTH
-VICINITY
-MINUTE
-MINUTES
-MIDNIGHT
-MIDWEEK
-MID
-MIDDLE
-NIGHTS
-MIDDAY
-RIDY
-LIE
-SISON
-VIDEO
-WITH
-WITHOUT
-WINDOWS
-LINUX
-BIGGEST
-NICE
-SIMON
-LIST
-SIZE
-FIT
-BIT
-FIND
-DIFFERENT
-EITHER
-FIST
-OKAY
-ALREADY
-ALL
-CLOSE
-ALRIGHT
-ELEVEN
-FLAG
-ELEVENTH
-CLOSEST
-CLOSER
-ALEX
-BLACKBOARD
-BLACKBOARDS
-ELSE
-ALTERNATIVE
-PLEASE
-PLUG
-AM
-IMMEDIATELY
-PM
-SMALL
-SMALLER
-SMALLEST
-ANY
-AND
-AN
-ANYTIME
-ENOUGH
-ANYTHING
-END
-ENDS
-IN
-INDEPENDENCE
-KNOW
-ENDING
-ANY_TIME
-ANTOINE
-ONE
-ON
-ONE'S
-INTERNET
-ANOTHER
-ONES
-UNDERSTAND
-UNITED
-UNTIL
-UNIT
-UNITS
-INFORMATION
-UNOCCUPIED
-BOHUS
-COULD
-DOES
-DO
-DON'T
-GOOD
-HOW
-HOLD
-CONVERSATION
-FOR
-LOT
-MORNING
-NOW
-GO
-GOING
-DOING
-GOODBYE
-SOME
-TOLD
-TO
-SORRY
-WOULD
-GOODNIGHT
-YOU
-YOU'RE
-YOUR
-NONE
-SOUNDS
-WORKS
-NOT
-SO
-COURSE
-CORRECT
-WONDERFUL
-COOL
-NO
-NOPE
-NOWHERE
-FOURTEEN
-FORTY
-FOUR'S
-FOURTH
-FOUR
-SOMETIME
-MONTH
-SORT
-SORTED
-FOLLOWING
-COMING
-FOOL'S
-FORCES
-MOTHERS'
-COLUMBUS
-FOURTEENTH
-NOVEMBER
-SOMEWHERE
-POSSIBLE
-HOURS
-NOON
-NOONTIME
-SOONER
-COUPLE
-MONDAY
-MONDAYS
-MONDAY'S
-TODAY
-TODAY'S
-TONIGHT
-TOMORROW
-TOMORROW'S
-MORNINGS
-SOON
-HOUR
-LONG
-COLOHAN
-MONITOR
-MONITORS
-BOARD
-BOARDS
-COMPUTER
-COMPUTERS
-CONNECTIVITY
-CONNECTED
-MORE
-HOLDS
-TOO
-ROOM
-WORK
-BOOK
-SOMETHING
-ROOMS
-CONFERENCE
-YOU'VE
-FOUND
-GOT
-COME
-COMES
-DOESN'T
-SOMEWHAT
-APRIL
-APPROXIMATELY
-OPTIONS
-UP
-EQUIPPED
-'ROUND
-ARE
-BREAK
-ARRANGE
-ARRANGED
-ARMED
-FROM
-GREAT
-GROUNDHOG
-AROUND
-FRIDAY
-FRIDAYS
-FRIDAY'S
-DRY
-ERASE
-OR
-PREFER
-ORDER
-ORDERED
-PREVIOUS
-PRESIDENTS'
-PRECEEDING
-PRIOR
-PROJECTOR
-PROJECTORS
-PROJECTING
-PROJECTION
-GROUP
-FREE
-PROPERTIES
-AS
-IS
-NSH
-US
-USER
-'TIL
-AT
-IT
-IT'S
-OTHER
-STAND
-START
-ST
-STARTS
-STARTING
-AUGUST
-CUSTOMER
-DURING
-GUESS
-HUNDRED
-GUEST
-JUST
-JULY
-LUTHER
-MUCH
-MUST
-JUNE
-NUMBER
-QUICK
-QUIT
-SURE
-SUSPEND
-QUARTER
-TUESDAY
-SUNDAY
-TUESDAYS
-YUP
-SUNDAYS
-TUESDAY'S
-SUNDAY'S
-RUDNICKY
-AVAILABLE
-AVERAGE
-EVENING
-EVERY
-EVERYDAY
-EVE
-EVENINGS
-OVER
-OVERHEAD
-AWAY
-TWELVE
-TWENTY
-TWO'S
-TWO
-TWENTIETH
-TWELFTH
-EXCUSE
-EXIT
-BY
-BYE
-BYEBYE
-MY
-SYSTEM
-A_M
-P_M
Deleted: TeamTalk/Resources/Grammar/pack_gra.perl
===================================================================
--- TeamTalk/Resources/Grammar/pack_gra.perl 2007-06-10 03:20:30 UTC (rev 632)
+++ TeamTalk/Resources/Grammar/pack_gra.perl 2007-06-11 16:47:47 UTC (rev 633)
@@ -1,7 +0,0 @@
-#!/usr/local/bin/perl
-
-while(<STDIN>) {
- chop;
- system("cat $_");
- system("echo ';\n\n'");
-}
Deleted: TeamTalk/Resources/Grammar/prs.bat
===================================================================
--- TeamTalk/Resources/Grammar/prs.bat 2007-06-10 03:20:30 UTC (rev 632)
+++ TeamTalk/Resources/Grammar/prs.bat 2007-06-11 16:47:47 UTC (rev 633)
@@ -1 +0,0 @@
-parse -dir . -grammar zap2.net
\ No newline at end of file
Deleted: TeamTalk/Resources/Grammar/stripbasedic.perl
===================================================================
--- TeamTalk/Resources/Grammar/stripbasedic.perl 2007-06-10 03:20:30 UTC (rev 632)
+++ TeamTalk/Resources/Grammar/stripbasedic.perl 2007-06-11 16:47:47 UTC (rev 633)
@@ -1,14 +0,0 @@
-#!/bin/perl
-
-# (dbohus): This program strips the base.dic file generated when compiling
-# the grammar into a simple dictionary file, that can be used through the
-# LM tool to generate the pronounciations
-
-while(<>) {
- chomp;
- if($_ =~ /^(.+?) (.+?)$/) {
- if(!($1 eq "<S>") && !($1 eq "</S>")) {
- printf $1."\n";
- }
- }
-}
Deleted: TeamTalk/Resources/Grammar/unpack_gra.perl
===================================================================
--- TeamTalk/Resources/Grammar/unpack_gra.perl 2007-06-10 03:20:30 UTC (rev 632)
+++ TeamTalk/Resources/Grammar/unpack_gra.perl 2007-06-11 16:47:47 UTC (rev 633)
@@ -1,16 +0,0 @@
-#!/usr/local/bin/perl
-
-open(IN,$ARGV[0]) || die "Can't open $ARGV[0]: $!";
-while(<IN>) {
- if ( /^;/ ) {
- close(OUT);
- next;
- }
- if ( /^\[/ ) {
- /\[(.*)\]/;
- $name= $1;
- open(OUT,">$name.gra") || die "Can't open $name: $!";
- }
-
- print OUT "$_";
-}
Deleted: TeamTalk/Resources/Grammar/unparsables.txt
===================================================================
--- TeamTalk/Resources/Grammar/unparsables.txt 2007-06-10 03:20:30 UTC (rev 632)
+++ TeamTalk/Resources/Grammar/unparsables.txt 2007-06-11 16:47:47 UTC (rev 633)
@@ -1,5 +0,0 @@
-[DateTime]
-[ ] tomorrow morning at ten -- does that parse ? It seemed not to,
- but then it seemed to parse again.
-[ ] from ten until seven p_m should parse as a single DateTime
-[ ] tomorrow morning from ten until seven p_m should parse as a single datetime
More information about the TeamTalk-developers
mailing list