From tk at edam.speech.cs.cmu.edu Wed Apr 4 15:47:52 2007 From: tk at edam.speech.cs.cmu.edu (tk@edam.speech.cs.cmu.edu) Date: Wed, 4 Apr 2007 15:47:52 -0400 Subject: [RavenclawDev 236] [13] Tools/: Created folder remotely Message-ID: <200704041947.l34JlqCI029278@edam.speech.cs.cmu.edu> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/ravenclaw-developers/attachments/20070404/3c04077f/attachment.html -------------- next part -------------- From tk at edam.speech.cs.cmu.edu Wed Apr 4 15:48:59 2007 From: tk at edam.speech.cs.cmu.edu (tk@edam.speech.cs.cmu.edu) Date: Wed, 4 Apr 2007 15:48:59 -0400 Subject: [RavenclawDev 237] [14] Tools: Added a folder remotely Message-ID: <200704041948.l34Jmxdn029288@edam.speech.cs.cmu.edu> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/ravenclaw-developers/attachments/20070404/dbe33b3f/attachment.html -------------- next part -------------- Added: Tools/RCTaskViz/RCTaskViz.pl =================================================================== --- Tools/RCTaskViz/RCTaskViz.pl (rev 0) +++ Tools/RCTaskViz/RCTaskViz.pl 2007-04-04 19:48:59 UTC (rev 14) @@ -0,0 +1,129 @@ +#!/bin/perl + +use English; +use strict; + +use GraphViz; + +my $g = GraphViz->new(directed => 1, layout => 'dot'); + +die "usage: $0 {dialog task filename}$/" if !@ARGV; +my $taskfile = shift; +open(TASKFILE, $taskfile) || die "could not open taskfile '$taskfile'$/"; + +my $MAX_LABEL = 55; +my @defaultattr = (shape => 'box', style => 'filled'); + +my $state = 1; +my %agency; +my $aref; +my $subref; +my $gref; +my $root; +my %hblah; +my @ablah; +my $agency_name; +while() { + if($state) { + if(/\/\*/) { + $state = 0; + next; + } + } else { + if(/\*\//) { + $state = 1; + } else { + next; + } + } + next if /^\s*\/\//; + if (/DEFINE_AGENCY\s*\(\s*([^,\s]+)/) { + #print "got DEFINE AGENCY$/"; + $agency_name = $1; + $aref = $agency{$agency_name} = {}; + $subref = ${$aref}{'subagents'} = []; + $gref = ${$aref}{'grammar'} = ''; + $g->add_node($agency_name, + @defaultattr, + shape => 'ellipse', + fillcolor => 'antiquewhite'); + } elsif (/DEFINE_EXPECT_AGENT\s*\(\s*([^,\s]+)/) { + $agency_name = $1; + $aref = $agency{$agency_name} = {}; + $subref = ${$aref}{'subagents'} = []; + $gref = ${$aref}{'grammar'} = ''; + $g->add_node($agency_name, @defaultattr, fillcolor => 'aquamarine'); + } elsif (/DEFINE_INFORM_AGENT\s*\(\s*([^,\s]+)/) { + $agency_name = $1; + $aref = $agency{$agency_name} = {}; + $subref = ${$aref}{'subagents'} = []; + $gref = ${$aref}{'grammar'} = ''; + $g->add_node($agency_name, @defaultattr, fillcolor => 'brown'); + } elsif (/DEFINE_REQUEST_AGENT\s*\(\s*([^,\s]+)/) { + $agency_name = $1; + $aref = $agency{$agency_name} = {}; + $subref = ${$aref}{'subagents'} = []; + $gref = ${$aref}{'grammar'} = ''; + $g->add_node($agency_name, @defaultattr, fillcolor => 'chartreuse'); + } elsif (/DEFINE_EXECUTE_AGENT\s*\(\s*([^,\s]+)/) { + $agency_name = $1; + $aref = $agency{$agency_name} = {}; + $subref = ${$aref}{'subagents'} = []; + $gref = ${$aref}{'grammar'} = ''; + $g->add_node($agency_name, @defaultattr, fillcolor => 'chocolate'); + } elsif (/SUBAGENT\([^,]+,\s*([^,\s]+)/) { + #print "got SUBAGENT$/"; + push @{$subref}, $1; + $g->add_node($1); + $g->add_edge($agency_name => $1); + } elsif (/DECLARE_DIALOG_TASK_ROOT\s*\([^,]+,\s*([^,\s]+)/) { + #print "got DECLARE DIALOG TASK ROOT$/"; + $root = $1; + } elsif (/GRAMMAR_MAPPING\s*\(/) { + my $tail = $POSTMATCH; + #print "tail: '$tail'$/"; + while($tail !~ /\)/) { + if($tail =~ /\S/) { + $tail =~ s/\s*$//; + $tail =~ s/^\s*//; + $gref .= $tail.' '; + #print "adding '$tail'$/"; + } + $tail = ; + } + if($tail =~ /(\S+)\)/) { + $gref .= $1; + #print "adding '$1'$/"; + } + if($gref) { + if(length($gref) > $MAX_LABEL) { + $gref = substr($gref, 0, $MAX_LABEL-3).'...'; + } + $g->add_node($agency_name, + 'label'=>$agency_name.': '.$gref); + } + } +} +#print_agency($root); +$g->as_canon('taskviz.txt'); +$g->as_png('taskviz.png'); + +sub print_agency { + my $name = shift; + my $level = shift; + + my $i = $level; + while($i--) {print "\t";} + print $name, $/; + my $aref = $agency{$name}; + my $type; + my $val; + for(keys %{$aref}) { + next if $_ = 'subagents'; + for($i = $level+1; $i; $i--) {print "\t";} + print "${_}: ${$aref}{$_}$/"; + } + for(@{${$aref}{'subagents'}}) { + &print_agency($_, $level+1); + } +} Added: Tools/RCTaskViz/README =================================================================== --- Tools/RCTaskViz/README (rev 0) +++ Tools/RCTaskViz/README 2007-04-04 19:48:59 UTC (rev 14) @@ -0,0 +1,12 @@ +This program parses the task structure. It produces a png of the graph +as well as the canonical text version compatible with AT&T's +Graphvis. In order to run it you'll need AT&T's graphviz and the +GraphVis perl module. + +Run with the task cpp file as an argument, as in + +$ ./RCTaskViz.pl ../../Agents/TeamTalkDM/TeamTalkDialogTask.cpp + +The png will be produced in that directory as 'taskviz.png' and the +AT&T compatible text format will be produced as 'taskviz.txt'. + Added: Tools/RCTaskViz/taskviz-example.png =================================================================== (Binary files differ) Property changes on: Tools/RCTaskViz/taskviz-example.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream From tk at edam.speech.cs.cmu.edu Thu Apr 5 10:26:19 2007 From: tk at edam.speech.cs.cmu.edu (tk@edam.speech.cs.cmu.edu) Date: Thu, 5 Apr 2007 10:26:19 -0400 Subject: [RavenclawDev 238] [15] Tools: Moved makelm into tools. Message-ID: <200704051426.l35EQJIv000623@edam.speech.cs.cmu.edu> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/ravenclaw-developers/attachments/20070405/c0857a14/attachment-0001.html -------------- next part -------------- Added: Tools/CMU-Cam_Toolkit_v2/README =================================================================== --- Tools/CMU-Cam_Toolkit_v2/README (rev 0) +++ Tools/CMU-Cam_Toolkit_v2/README 2007-04-05 14:26:18 UTC (rev 15) @@ -0,0 +1,84 @@ +CMU-Cambridge Statistical Language Modeling Tookit v2 +===================================================== + +Documentation: +-------------- + +For installation and usage instructions for the toolkit, see + +doc/toolkit_documentation.html + +(for the sake of convenience, the installation instructions are also +given below). + +Installation: +------------- + +For "big-endian" machines (eg those running HP-UX, IRIX, SunOS, +Solaris) the installation procedure is simply to type + + cd src + make install + +The executables will then be copied into the bin/ directory, and the +library file SLM2.a will be copied into the lib/ directory. + +For "little-endian" machines (eg those running Ultrix, Linux) the +variable "BYTESWAP_FLAG" will need to be set in the Makefile. This can +be done by editing src/Makefile directly, so that the line + +#BYTESWAP_FLAG = -DSLM_SWAP_BYTES + +is changed to + +BYTESWAP_FLAG = -DSLM_SWAP_BYTES + +Then the program can be installed as before. + +If you are unsure of the "endian-ness" of your machine, then the shell +script endian.sh should be able to provide some assistance. + +In case of problems, then more information can be found by examining +src/Makefile. + +Files: +------ + +endian.sh Shell script to report "endian-ness" (see installation + instructions). Not terribly robust; needs to be able to see gcc, + for example. + +doc/toolkit_documentation.html The standard html documentation for the + toolkit. View using netscape or equivalent. + +doc/toolkit_documentation_no_tables.html As above, but doesn't use + tables, so is suitable for use with browsers which don't support + tables (eg lynx). + +doc/toolkit_documentation.txt The documentation in flat text. + +doc/change_log.html List of changes from version to version. + +doc/change_log.txt The above in flat text. + +src/*.c src/*.h The toolkit source files + +src/Makefile The standard make file. + +src/install-sh Shell script to install executables in the appropriate + directory. An improvement on cp, as it will check to see whether it is + about to overwrite an execuatable which is already in use. + +include/SLM2.h File containing all of src/*.h, allowing + functions from the toolkit to be included in new software. + +bin/ Directory where executables will be installed. + +lib/ Directory where SLM2.a will be stored (useful in conjunction with + include/SLM2.h for including functions from the toolkit to be included + in new software.) + + + + + Added: Tools/CMU-Cam_Toolkit_v2/bin/binlm2arpa.exe =================================================================== (Binary files differ) Property changes on: Tools/CMU-Cam_Toolkit_v2/bin/binlm2arpa.exe ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: Tools/CMU-Cam_Toolkit_v2/bin/blah.idngram =================================================================== (Binary files differ) Property changes on: Tools/CMU-Cam_Toolkit_v2/bin/blah.idngram ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: Tools/CMU-Cam_Toolkit_v2/bin/evallm.exe =================================================================== (Binary files differ) Property changes on: Tools/CMU-Cam_Toolkit_v2/bin/evallm.exe ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: Tools/CMU-Cam_Toolkit_v2/bin/idngram2lm.exe =================================================================== (Binary files differ) Property changes on: Tools/CMU-Cam_Toolkit_v2/bin/idngram2lm.exe ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: Tools/CMU-Cam_Toolkit_v2/bin/idngram2stats.exe =================================================================== (Binary files differ) Property changes on: Tools/CMU-Cam_Toolkit_v2/bin/idngram2stats.exe ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: Tools/CMU-Cam_Toolkit_v2/bin/interpolate.exe =================================================================== (Binary files differ) Property changes on: Tools/CMU-Cam_Toolkit_v2/bin/interpolate.exe ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: Tools/CMU-Cam_Toolkit_v2/bin/mergeidngram.exe =================================================================== (Binary files differ) Property changes on: Tools/CMU-Cam_Toolkit_v2/bin/mergeidngram.exe ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: Tools/CMU-Cam_Toolkit_v2/bin/ngram2mgram.exe =================================================================== (Binary files differ) Property changes on: Tools/CMU-Cam_Toolkit_v2/bin/ngram2mgram.exe ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: Tools/CMU-Cam_Toolkit_v2/bin/text2idngram.exe =================================================================== (Binary files differ) Property changes on: Tools/CMU-Cam_Toolkit_v2/bin/text2idngram.exe ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: Tools/CMU-Cam_Toolkit_v2/bin/text2wfreq.exe =================================================================== (Binary files differ) Property changes on: Tools/CMU-Cam_Toolkit_v2/bin/text2wfreq.exe ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: Tools/CMU-Cam_Toolkit_v2/bin/text2wngram.exe =================================================================== (Binary files differ) Property changes on: Tools/CMU-Cam_Toolkit_v2/bin/text2wngram.exe ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: Tools/CMU-Cam_Toolkit_v2/bin/wfreq2vocab.exe =================================================================== (Binary files differ) Property changes on: Tools/CMU-Cam_Toolkit_v2/bin/wfreq2vocab.exe ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: Tools/CMU-Cam_Toolkit_v2/bin/wngram2idngram.exe =================================================================== (Binary files differ) Property changes on: Tools/CMU-Cam_Toolkit_v2/bin/wngram2idngram.exe ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: Tools/CMU-Cam_Toolkit_v2/endian.sh =================================================================== --- Tools/CMU-Cam_Toolkit_v2/endian.sh (rev 0) +++ Tools/CMU-Cam_Toolkit_v2/endian.sh 2007-04-05 14:26:18 UTC (rev 15) @@ -0,0 +1,29 @@ +#!/bin/sh + +# Dumb shell script to report endianness. + +echo " + #define BIG_ENDIAN 0 + #define LITTLE_ENDIAN 1 + + int little_endian(void) + { + short int w = 0x0001; + char *byte = (char *) &w; + return(byte[0] ? LITTLE_ENDIAN : BIG_ENDIAN); + } + +main () { + if(!little_endian()) { + printf(\"Big-endian, DO NOT set -DSLM_SWAP_BYTES in Makefile\\n\"); + } + else { + printf(\"Little-endian, set -DSLM_SWAP_BYTES in Makefile\\n\"); + } +}" > test_endian.c +gcc test_endian.c -o test_endian + +# Can use cc if gcc not available. + +./test_endian +rm -f test_endian test_endian.c Added: Tools/CMU-Cam_Toolkit_v2/test_endian.exe =================================================================== (Binary files differ) Property changes on: Tools/CMU-Cam_Toolkit_v2/test_endian.exe ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: Tools/generate_random_samples.pl =================================================================== --- Tools/generate_random_samples.pl (rev 0) +++ Tools/generate_random_samples.pl 2007-04-05 14:26:18 UTC (rev 15) @@ -0,0 +1,1015 @@ +#!/usr/bin/perl +# This line tells emacs, that this is a -*-Perl-*- program + +$licence = <) { + + $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; + +#warn join($/, @{$top_level_slots[$#top_level_slots]}), $/; + +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() { + 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 + +#foreach(keys %nets) { +# print STDERR "Loading grammar file $_ ............\r"; +# +# $NAME=$_; +# load_grammar_file("$NAME.gra"); +#} +load_grammar_file('zap2flat.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{$_}++; + } +} + at 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 "\n\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"; + at 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); + + #warn "print_random_sentence: top_level[select] -> $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(); + #foreach $select_local (@{$top_level_slots[$select]}) { + # tk - fix + # I don't understand, but without this fix every line would be a sucession of each net. + $select_local = $top_level_slots[$select][int(rand(scalar(@{$top_level_slots[$select]})))]; + $break=1; + while($break) { + $break=0; + print_net_random($select_local); + if($break) { + break_noise(); + } + else { + segment_noise(); + } + } + #} + 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_prob1\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); + at return=grep(/\S/, at return); +warn "$global_netname could expand to empty, ignored\n" +unless @return==$ret_length; + at 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 = ""; + at rules = (); +$conceptclass=0; + +open(GRAMMAR,$GRAMMAR_FILE); +while() { +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"}++; +} + + at rules = (); + at 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) { + at pron = allchunk(join("\266", at _)); +} +elsif(($pronword=~s/\266S$/\'S/) && (defined $vocab{$pronword}) && @{$vocab{$pronword}}>0) { + at pron = allchunk($pronword); +} +else { + at 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 < +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); +} Added: Tools/makelm.pl =================================================================== --- Tools/makelm.pl (rev 0) +++ Tools/makelm.pl 2007-04-05 14:26:18 UTC (rev 15) @@ -0,0 +1,277 @@ +#!/usr/bin/perl + +use LWP::UserAgent; +use HTTP::Request::Common; +use File::Spec; +use File::Copy; +use File::stat; +$ENV{'LC_COLLATE'} = 'C'; +$ENV{'LC_ALL'} = 'C'; +use locale; + +my $project = 'zap2'; +my $SAMPSIZE = scalar @ARGV? shift: 30000; + +$GRAMMARDIR = File::Spec->catdir(File::Spec->updir(), 'Grammar'); +$GRAMMARFILE = File::Spec->catfile($GRAMMARDIR, $project.'.gra'); +$FLATGRAMMARFILE = File::Spec->catfile($GRAMMARDIR, $project.'flat.gra'); +$CORPUS = 'tempfile'; +$BASEDIC = File::Spec->catfile($GRAMMARDIR, 'base.dic'); +$VOCAB = 'vocab'; +$CCS = 'temp.ccs'; +$PHOENIX = File::Spec->catfile($GRAMMARDIR, 'compile.exe'); +$TEXT2IDNGRAM = File::Spec->catfile('CMU-Cam_Toolkit_v2', 'bin', 'text2idngram'); +$IDNGRAM2LM = File::Spec->catfile('CMU-Cam_Toolkit_v2', 'bin', 'idngram2lm'); +$RANDOMSAMPS = 'generate_random_samples.pl'; +$IDNGRAM = $project.'.idngram'; +$LM = File::Spec->catfile(File::Spec->updir(), 'DecoderConfig', 'LanguageModel', + $project.'LM.arpa'); +$DICT = File::Spec->catfile(File::Spec->updir(), 'DecoderConfig', 'Dictionary', + $project.'.dict'); +$REDUCED_DICT = $DICT.'.reduced_phoneset'; + +#get language model +#copy('../Grammar/ZapTask.gra', '../Grammar/Zap.gra'); +#copy('../Grammar/ZapTask.forms', '../Grammar/forms'); +#chdir '../Grammar'; +#system('mk_nets2.pl Zap.gra'); +#chdir '../MakeLM'; +#system("$PHOENIX -g $GRAMMARDIR -f ..\\Grammar\\Zap"); +&say('compile', 'compiling grammar...'); +chdir($GRAMMARDIR); +system('cmp.bat'); +&say('compile', 'compiling language model...'); +chdir('../MakeLM'); +&say('compile', 'generating corpus...'); +&getcorpus($CORPUS); +&say('compile', 'getting vocabulary...'); +&getvocab($BASEDIC, $VOCAB, $CCS); +&say('compile', 'computing ngrams...'); +my $cmd = "$TEXT2IDNGRAM -vocab $VOCAB -temp . -write_ascii < $CORPUS > $IDNGRAM"; +&say('compile', $cmd); +die "text2idngram failed$/" if system($cmd); +&say('compile', 'computing language model...'); +$cmd = "$IDNGRAM2LM -idngram $IDNGRAM -vocab $VOCAB -arpa $LM -context $CCS -vocab_type 0 -good_turing -disc_ranges 0 0 0 -ascii_input"; +#$cmd = "$IDNGRAM2LM -idngram $IDNGRAM -vocab $VOCAB -arpa $LM -context $CCS -vocab_type 0 -absolute -ascii_input"; +#$cmd = "$IDNGRAM2LM -idngram $IDNGRAM -vocab $VOCAB -arpa $LM -context $CCS -vocab_type 0 -ascii_input"; +&say('compile', "$cmd$/"); +die "idngram2lm failed$/" if system($cmd); + +#get dictionary +&say('compile', 'compiling dictionary...'); +&getdict($DICT, $REDUCED_DICT, $VOCAB); +&say('compile', "done\n"); + +sub getcorpus { + my $corpusfile = shift; + #flatten grammar + open(ZAPGRA, $GRAMMARFILE) || die "Can't open grammar file$/"; + open(ZAPFLAT, ">$FLATGRAMMARFILE") || die "Can't open grammar flat file$/"; + print ZAPFLAT &flat(); + close ZAPGRA; + close ZAPFLAT; + + open(RANDOM, "$RANDOMSAMPS -n $SAMPSIZE -d $GRAMMARDIR|") || + die "Cannot execute $RANDOMSAMPS$/"; + open(CORPUS, ">$corpusfile") || die "Can't open $corpusfile$/"; + binmode CORPUS; + while () { + $_ = uc($_); + chomp; + s/<\/?S> //g; + print CORPUS " $_ \n"; + } + close CORPUS; +} + +sub getvocab { + my $basefile = shift; + my $vocab = shift; + my $ccs = shift; + open(VOCAB, ">$vocab") || die "Can't open $vocab$/"; + binmode VOCAB; + open(BASE, "<$basefile") || die "Can't open $basefile$/"; + my @base = map { /(.*) .*/? uc("$1\n"): () } ; + print VOCAB grep !/<\/?S>/, sort(@base); + print VOCAB "\n"; + print VOCAB "\n"; + close VOCAB; + open(CCS, ">$ccs") || die "Can't open $ccs$/"; + binmode CCS; + print CCS "\n"; + close CCS; +} + +sub getdict { + my $dict = shift; + my $reduced = shift; + my $vocab = shift; + my @long; + open(DICT, ">$dict") || die "Can't open $dict$/"; + binmode DICT; + open(REDUCED, ">$reduced") || die "Can't open $reduced$/"; + binmode REDUCED; + open(VOCAB, "<$vocab") || die "Can't open $vocab$/"; + for () { + s/=/_/g; + push @long, $_; + } + foreach (&shorten(@long)) { + s/_/=/g; + print DICT "$_\n"; + s/\bIX\b/AX/g; + print REDUCED "$_\n"; + } + close DICT; + close REDUCED; +} + +sub shorten { + open (OUTFILE, ">outfile.tmp"); + open (LONGFILE, ">longfile.tmp"); + + my $counter = 0; + my $not_done = 1; + my @listlongwords; + + foreach (@_) { + my @blah = split / /, $_; + for my $i (@blah) { + my $len = length $i; + if ($len >= 35) { + for my $m (@listlongwords) { + if ($m =~ /$i/) { + $not_done = 0; + } + } + + if ($not_done) { + push(@listlongwords, $i); + } + + $not_done = 1; + my @words = split /_/, $i; + for my $j (@words) { + print LONGFILE "$j "; + } + print LONGFILE "\n"; + } else { + print OUTFILE "$i "; + } + } + } + + close(OUTFILE); + close(LONGFILE); + + my @diclines = + grep !(/CONTENT-TYPE/ || /TEXT\/PLAIN/), &getdic('outfile.tmp'); + unlink 'outfile.tmp'; + my @longlines = stat('longfile.tmp')->size? + grep !(/CONTENT-TYPE/ || /TEXT\/PLAIN/), &getdic('longfile.tmp'): (); + unlink 'longfile.tmp'; + + my $not_used = 1; + + for my $i (@listlongwords) { + chomp $i; + my $lotsaphones = "$i "; + my @word_parts = split /_/, $i; + for my $word (@word_parts) { + $word =~ s/(\W)/\\$1/; + #warn "the word to look up is $word\n"; + for my $j (@longlines) { + if ($not_used) { + if ($j =~ /^$word\t/) { + my @pronounciation = split /\t/, $j; + chomp $pronounciation[1]; + $lotsaphones .= "$pronounciation[1] "; + $not_used = 0; + } + } + } + $not_used = 1; + } + $lotsaphones .= "\n"; + push @diclines, $lotsaphones; + } + return @diclines; +} + +sub getdic { + if ($#_ == -1) { + die "Need the corpus location as an argument\n"; + } + + my $ua = new LWP::UserAgent; + my $res = $ua->request(POST 'http://fife.speech.cs.cmu.edu/cgi-bin/tools/lmtool.2.pl', + Content_Type => 'form-data', + Content => [formtype => 'simple', + corpus => [$_[0]], + #handdict => undef, + #extrawords => undef, + #phoneset => '40', + #bracket => 'Yes', + #model => 'Bigram', + #class => 'nil', + #discount => '0.5', + submit => 'COMPILE KNOWLEDGE BASE']); + + my $result; + if ($res->is_success) { + $result = $res->content; + } else { + die "Couldn't execute the perl script, probably error in the form$/"; + } + + if ($result =~ /\!-- DIC.*ct\/\/(.*)\">/) { + + my $blah = "http://fife.speech.cs.cmu.edu/tools/product//$1"; + $res = $ua->request(GET $blah); + + if ($res->is_success) { + return split(/\n/, $res->content); + } else { + die "Can't find dictionary file$/"; + } + } else { + die "Couldn't parse the result: $result$/"; + } +} + +sub say { + print shift, ": ", shift, $/; +} + +sub flat { + my @unflat = @_; + my @result; + for (@unflat) { + if (!s/^\s*\((.*)\)/$1/) { + push @result, $_; + } else { + my @stack; + my %flathash; + push(@stack, [split]); + while (my $buffref = shift @stack) { + my $i = 0; + my @buff = @$buffref; + my $flat; + for (@buff) { + if (/^\*(.*)/) { + $flat .= "$1 "; + push(@stack, [ @buff[0..$i-1], @buff[$i+1..$#buff] ]); + } else { + $flat .= "$_ "; + } + $i++; + } + $flathash{$flat} = 1; + } + foreach (keys %flathash) { + push @result, "\t( $_)\n"; + } + } + } + @result; +} From tk at edam.speech.cs.cmu.edu Thu Apr 5 10:27:37 2007 From: tk at edam.speech.cs.cmu.edu (tk@edam.speech.cs.cmu.edu) Date: Thu, 5 Apr 2007 10:27:37 -0400 Subject: [RavenclawDev 239] [16] Tools/MakeLM/: Created folder remotely Message-ID: <200704051427.l35ERbfl000633@edam.speech.cs.cmu.edu> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/ravenclaw-developers/attachments/20070405/cae2fd3c/attachment.html -------------- next part -------------- From tk at edam.speech.cs.cmu.edu Thu Apr 5 10:28:48 2007 From: tk at edam.speech.cs.cmu.edu (tk@edam.speech.cs.cmu.edu) Date: Thu, 5 Apr 2007 10:28:48 -0400 Subject: [RavenclawDev 240] [17] Tools: Moved remotely Message-ID: <200704051428.l35ESmgt000643@edam.speech.cs.cmu.edu> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/ravenclaw-developers/attachments/20070405/c6ab01c7/attachment.html -------------- next part -------------- Copied: Tools/MakeLM/CMU-Cam_Toolkit_v2 (from rev 16, Tools/CMU-Cam_Toolkit_v2) From tk at edam.speech.cs.cmu.edu Thu Apr 5 10:28:59 2007 From: tk at edam.speech.cs.cmu.edu (tk@edam.speech.cs.cmu.edu) Date: Thu, 5 Apr 2007 10:28:59 -0400 Subject: [RavenclawDev 241] [18] Tools: Moved remotely Message-ID: <200704051428.l35ESxfn000653@edam.speech.cs.cmu.edu> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/ravenclaw-developers/attachments/20070405/a1796fb7/attachment-0001.html -------------- next part -------------- Copied: Tools/MakeLM/generate_random_samples.pl (from rev 17, Tools/generate_random_samples.pl) =================================================================== --- Tools/MakeLM/generate_random_samples.pl (rev 0) +++ Tools/MakeLM/generate_random_samples.pl 2007-04-05 14:28:59 UTC (rev 18) @@ -0,0 +1,1015 @@ +#!/usr/bin/perl +# This line tells emacs, that this is a -*-Perl-*- program + +$licence = <) { + + $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; + +#warn join($/, @{$top_level_slots[$#top_level_slots]}), $/; + +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() { + 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 + +#foreach(keys %nets) { +# print STDERR "Loading grammar file $_ ............\r"; +# +# $NAME=$_; +# load_grammar_file("$NAME.gra"); +#} +load_grammar_file('zap2flat.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{$_}++; + } +} + at 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 "\n\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"; + at 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); + + #warn "print_random_sentence: top_level[select] -> $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(); + #foreach $select_local (@{$top_level_slots[$select]}) { + # tk - fix + # I don't understand, but without this fix every line would be a sucession of each net. + $select_local = $top_level_slots[$select][int(rand(scalar(@{$top_level_slots[$select]})))]; + $break=1; + while($break) { + $break=0; + print_net_random($select_local); + if($break) { + break_noise(); + } + else { + segment_noise(); + } + } + #} + 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_prob1\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); + at return=grep(/\S/, at return); +warn "$global_netname could expand to empty, ignored\n" +unless @return==$ret_length; + at 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 = ""; + at rules = (); +$conceptclass=0; + +open(GRAMMAR,$GRAMMAR_FILE); +while() { +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"}++; +} + + at rules = (); + at 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) { + at pron = allchunk(join("\266", at _)); +} +elsif(($pronword=~s/\266S$/\'S/) && (defined $vocab{$pronword}) && @{$vocab{$pronword}}>0) { + at pron = allchunk($pronword); +} +else { + at 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 < +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: Tools/generate_random_samples.pl =================================================================== --- Tools/generate_random_samples.pl 2007-04-05 14:28:48 UTC (rev 17) +++ Tools/generate_random_samples.pl 2007-04-05 14:28:59 UTC (rev 18) @@ -1,1015 +0,0 @@ -#!/usr/bin/perl -# This line tells emacs, that this is a -*-Perl-*- program - -$licence = <) { - - $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; - -#warn join($/, @{$top_level_slots[$#top_level_slots]}), $/; - -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() { - 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 - -#foreach(keys %nets) { -# print STDERR "Loading grammar file $_ ............\r"; -# -# $NAME=$_; -# load_grammar_file("$NAME.gra"); -#} -load_grammar_file('zap2flat.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{$_}++; - } -} - at 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 "\n\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"; - at 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); - - #warn "print_random_sentence: top_level[select] -> $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(); - #foreach $select_local (@{$top_level_slots[$select]}) { - # tk - fix - # I don't understand, but without this fix every line would be a sucession of each net. - $select_local = $top_level_slots[$select][int(rand(scalar(@{$top_level_slots[$select]})))]; - $break=1; - while($break) { - $break=0; - print_net_random($select_local); - if($break) { - break_noise(); - } - else { - segment_noise(); - } - } - #} - 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_prob1\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); - at return=grep(/\S/, at return); -warn "$global_netname could expand to empty, ignored\n" -unless @return==$ret_length; - at 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 = ""; - at rules = (); -$conceptclass=0; - -open(GRAMMAR,$GRAMMAR_FILE); -while() { -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"}++; -} - - at rules = (); - at 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) { - at pron = allchunk(join("\266", at _)); -} -elsif(($pronword=~s/\266S$/\'S/) && (defined $vocab{$pronword}) && @{$vocab{$pronword}}>0) { - at pron = allchunk($pronword); -} -else { - at 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 < -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); -} From tk at edam.speech.cs.cmu.edu Thu Apr 5 10:29:08 2007 From: tk at edam.speech.cs.cmu.edu (tk@edam.speech.cs.cmu.edu) Date: Thu, 5 Apr 2007 10:29:08 -0400 Subject: [RavenclawDev 242] [19] Tools: Moved remotely Message-ID: <200704051429.l35ET8rT000663@edam.speech.cs.cmu.edu> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/ravenclaw-developers/attachments/20070405/16845b02/attachment.html -------------- next part -------------- Copied: Tools/MakeLM/makelm.pl (from rev 18, Tools/makelm.pl) =================================================================== --- Tools/MakeLM/makelm.pl (rev 0) +++ Tools/MakeLM/makelm.pl 2007-04-05 14:29:08 UTC (rev 19) @@ -0,0 +1,277 @@ +#!/usr/bin/perl + +use LWP::UserAgent; +use HTTP::Request::Common; +use File::Spec; +use File::Copy; +use File::stat; +$ENV{'LC_COLLATE'} = 'C'; +$ENV{'LC_ALL'} = 'C'; +use locale; + +my $project = 'zap2'; +my $SAMPSIZE = scalar @ARGV? shift: 30000; + +$GRAMMARDIR = File::Spec->catdir(File::Spec->updir(), 'Grammar'); +$GRAMMARFILE = File::Spec->catfile($GRAMMARDIR, $project.'.gra'); +$FLATGRAMMARFILE = File::Spec->catfile($GRAMMARDIR, $project.'flat.gra'); +$CORPUS = 'tempfile'; +$BASEDIC = File::Spec->catfile($GRAMMARDIR, 'base.dic'); +$VOCAB = 'vocab'; +$CCS = 'temp.ccs'; +$PHOENIX = File::Spec->catfile($GRAMMARDIR, 'compile.exe'); +$TEXT2IDNGRAM = File::Spec->catfile('CMU-Cam_Toolkit_v2', 'bin', 'text2idngram'); +$IDNGRAM2LM = File::Spec->catfile('CMU-Cam_Toolkit_v2', 'bin', 'idngram2lm'); +$RANDOMSAMPS = 'generate_random_samples.pl'; +$IDNGRAM = $project.'.idngram'; +$LM = File::Spec->catfile(File::Spec->updir(), 'DecoderConfig', 'LanguageModel', + $project.'LM.arpa'); +$DICT = File::Spec->catfile(File::Spec->updir(), 'DecoderConfig', 'Dictionary', + $project.'.dict'); +$REDUCED_DICT = $DICT.'.reduced_phoneset'; + +#get language model +#copy('../Grammar/ZapTask.gra', '../Grammar/Zap.gra'); +#copy('../Grammar/ZapTask.forms', '../Grammar/forms'); +#chdir '../Grammar'; +#system('mk_nets2.pl Zap.gra'); +#chdir '../MakeLM'; +#system("$PHOENIX -g $GRAMMARDIR -f ..\\Grammar\\Zap"); +&say('compile', 'compiling grammar...'); +chdir($GRAMMARDIR); +system('cmp.bat'); +&say('compile', 'compiling language model...'); +chdir('../MakeLM'); +&say('compile', 'generating corpus...'); +&getcorpus($CORPUS); +&say('compile', 'getting vocabulary...'); +&getvocab($BASEDIC, $VOCAB, $CCS); +&say('compile', 'computing ngrams...'); +my $cmd = "$TEXT2IDNGRAM -vocab $VOCAB -temp . -write_ascii < $CORPUS > $IDNGRAM"; +&say('compile', $cmd); +die "text2idngram failed$/" if system($cmd); +&say('compile', 'computing language model...'); +$cmd = "$IDNGRAM2LM -idngram $IDNGRAM -vocab $VOCAB -arpa $LM -context $CCS -vocab_type 0 -good_turing -disc_ranges 0 0 0 -ascii_input"; +#$cmd = "$IDNGRAM2LM -idngram $IDNGRAM -vocab $VOCAB -arpa $LM -context $CCS -vocab_type 0 -absolute -ascii_input"; +#$cmd = "$IDNGRAM2LM -idngram $IDNGRAM -vocab $VOCAB -arpa $LM -context $CCS -vocab_type 0 -ascii_input"; +&say('compile', "$cmd$/"); +die "idngram2lm failed$/" if system($cmd); + +#get dictionary +&say('compile', 'compiling dictionary...'); +&getdict($DICT, $REDUCED_DICT, $VOCAB); +&say('compile', "done\n"); + +sub getcorpus { + my $corpusfile = shift; + #flatten grammar + open(ZAPGRA, $GRAMMARFILE) || die "Can't open grammar file$/"; + open(ZAPFLAT, ">$FLATGRAMMARFILE") || die "Can't open grammar flat file$/"; + print ZAPFLAT &flat(); + close ZAPGRA; + close ZAPFLAT; + + open(RANDOM, "$RANDOMSAMPS -n $SAMPSIZE -d $GRAMMARDIR|") || + die "Cannot execute $RANDOMSAMPS$/"; + open(CORPUS, ">$corpusfile") || die "Can't open $corpusfile$/"; + binmode CORPUS; + while () { + $_ = uc($_); + chomp; + s/<\/?S> //g; + print CORPUS " $_ \n"; + } + close CORPUS; +} + +sub getvocab { + my $basefile = shift; + my $vocab = shift; + my $ccs = shift; + open(VOCAB, ">$vocab") || die "Can't open $vocab$/"; + binmode VOCAB; + open(BASE, "<$basefile") || die "Can't open $basefile$/"; + my @base = map { /(.*) .*/? uc("$1\n"): () } ; + print VOCAB grep !/<\/?S>/, sort(@base); + print VOCAB "\n"; + print VOCAB "\n"; + close VOCAB; + open(CCS, ">$ccs") || die "Can't open $ccs$/"; + binmode CCS; + print CCS "\n"; + close CCS; +} + +sub getdict { + my $dict = shift; + my $reduced = shift; + my $vocab = shift; + my @long; + open(DICT, ">$dict") || die "Can't open $dict$/"; + binmode DICT; + open(REDUCED, ">$reduced") || die "Can't open $reduced$/"; + binmode REDUCED; + open(VOCAB, "<$vocab") || die "Can't open $vocab$/"; + for () { + s/=/_/g; + push @long, $_; + } + foreach (&shorten(@long)) { + s/_/=/g; + print DICT "$_\n"; + s/\bIX\b/AX/g; + print REDUCED "$_\n"; + } + close DICT; + close REDUCED; +} + +sub shorten { + open (OUTFILE, ">outfile.tmp"); + open (LONGFILE, ">longfile.tmp"); + + my $counter = 0; + my $not_done = 1; + my @listlongwords; + + foreach (@_) { + my @blah = split / /, $_; + for my $i (@blah) { + my $len = length $i; + if ($len >= 35) { + for my $m (@listlongwords) { + if ($m =~ /$i/) { + $not_done = 0; + } + } + + if ($not_done) { + push(@listlongwords, $i); + } + + $not_done = 1; + my @words = split /_/, $i; + for my $j (@words) { + print LONGFILE "$j "; + } + print LONGFILE "\n"; + } else { + print OUTFILE "$i "; + } + } + } + + close(OUTFILE); + close(LONGFILE); + + my @diclines = + grep !(/CONTENT-TYPE/ || /TEXT\/PLAIN/), &getdic('outfile.tmp'); + unlink 'outfile.tmp'; + my @longlines = stat('longfile.tmp')->size? + grep !(/CONTENT-TYPE/ || /TEXT\/PLAIN/), &getdic('longfile.tmp'): (); + unlink 'longfile.tmp'; + + my $not_used = 1; + + for my $i (@listlongwords) { + chomp $i; + my $lotsaphones = "$i "; + my @word_parts = split /_/, $i; + for my $word (@word_parts) { + $word =~ s/(\W)/\\$1/; + #warn "the word to look up is $word\n"; + for my $j (@longlines) { + if ($not_used) { + if ($j =~ /^$word\t/) { + my @pronounciation = split /\t/, $j; + chomp $pronounciation[1]; + $lotsaphones .= "$pronounciation[1] "; + $not_used = 0; + } + } + } + $not_used = 1; + } + $lotsaphones .= "\n"; + push @diclines, $lotsaphones; + } + return @diclines; +} + +sub getdic { + if ($#_ == -1) { + die "Need the corpus location as an argument\n"; + } + + my $ua = new LWP::UserAgent; + my $res = $ua->request(POST 'http://fife.speech.cs.cmu.edu/cgi-bin/tools/lmtool.2.pl', + Content_Type => 'form-data', + Content => [formtype => 'simple', + corpus => [$_[0]], + #handdict => undef, + #extrawords => undef, + #phoneset => '40', + #bracket => 'Yes', + #model => 'Bigram', + #class => 'nil', + #discount => '0.5', + submit => 'COMPILE KNOWLEDGE BASE']); + + my $result; + if ($res->is_success) { + $result = $res->content; + } else { + die "Couldn't execute the perl script, probably error in the form$/"; + } + + if ($result =~ /\!-- DIC.*ct\/\/(.*)\">/) { + + my $blah = "http://fife.speech.cs.cmu.edu/tools/product//$1"; + $res = $ua->request(GET $blah); + + if ($res->is_success) { + return split(/\n/, $res->content); + } else { + die "Can't find dictionary file$/"; + } + } else { + die "Couldn't parse the result: $result$/"; + } +} + +sub say { + print shift, ": ", shift, $/; +} + +sub flat { + my @unflat = @_; + my @result; + for (@unflat) { + if (!s/^\s*\((.*)\)/$1/) { + push @result, $_; + } else { + my @stack; + my %flathash; + push(@stack, [split]); + while (my $buffref = shift @stack) { + my $i = 0; + my @buff = @$buffref; + my $flat; + for (@buff) { + if (/^\*(.*)/) { + $flat .= "$1 "; + push(@stack, [ @buff[0..$i-1], @buff[$i+1..$#buff] ]); + } else { + $flat .= "$_ "; + } + $i++; + } + $flathash{$flat} = 1; + } + foreach (keys %flathash) { + push @result, "\t( $_)\n"; + } + } + } + @result; +} Deleted: Tools/makelm.pl =================================================================== --- Tools/makelm.pl 2007-04-05 14:28:59 UTC (rev 18) +++ Tools/makelm.pl 2007-04-05 14:29:08 UTC (rev 19) @@ -1,277 +0,0 @@ -#!/usr/bin/perl - -use LWP::UserAgent; -use HTTP::Request::Common; -use File::Spec; -use File::Copy; -use File::stat; -$ENV{'LC_COLLATE'} = 'C'; -$ENV{'LC_ALL'} = 'C'; -use locale; - -my $project = 'zap2'; -my $SAMPSIZE = scalar @ARGV? shift: 30000; - -$GRAMMARDIR = File::Spec->catdir(File::Spec->updir(), 'Grammar'); -$GRAMMARFILE = File::Spec->catfile($GRAMMARDIR, $project.'.gra'); -$FLATGRAMMARFILE = File::Spec->catfile($GRAMMARDIR, $project.'flat.gra'); -$CORPUS = 'tempfile'; -$BASEDIC = File::Spec->catfile($GRAMMARDIR, 'base.dic'); -$VOCAB = 'vocab'; -$CCS = 'temp.ccs'; -$PHOENIX = File::Spec->catfile($GRAMMARDIR, 'compile.exe'); -$TEXT2IDNGRAM = File::Spec->catfile('CMU-Cam_Toolkit_v2', 'bin', 'text2idngram'); -$IDNGRAM2LM = File::Spec->catfile('CMU-Cam_Toolkit_v2', 'bin', 'idngram2lm'); -$RANDOMSAMPS = 'generate_random_samples.pl'; -$IDNGRAM = $project.'.idngram'; -$LM = File::Spec->catfile(File::Spec->updir(), 'DecoderConfig', 'LanguageModel', - $project.'LM.arpa'); -$DICT = File::Spec->catfile(File::Spec->updir(), 'DecoderConfig', 'Dictionary', - $project.'.dict'); -$REDUCED_DICT = $DICT.'.reduced_phoneset'; - -#get language model -#copy('../Grammar/ZapTask.gra', '../Grammar/Zap.gra'); -#copy('../Grammar/ZapTask.forms', '../Grammar/forms'); -#chdir '../Grammar'; -#system('mk_nets2.pl Zap.gra'); -#chdir '../MakeLM'; -#system("$PHOENIX -g $GRAMMARDIR -f ..\\Grammar\\Zap"); -&say('compile', 'compiling grammar...'); -chdir($GRAMMARDIR); -system('cmp.bat'); -&say('compile', 'compiling language model...'); -chdir('../MakeLM'); -&say('compile', 'generating corpus...'); -&getcorpus($CORPUS); -&say('compile', 'getting vocabulary...'); -&getvocab($BASEDIC, $VOCAB, $CCS); -&say('compile', 'computing ngrams...'); -my $cmd = "$TEXT2IDNGRAM -vocab $VOCAB -temp . -write_ascii < $CORPUS > $IDNGRAM"; -&say('compile', $cmd); -die "text2idngram failed$/" if system($cmd); -&say('compile', 'computing language model...'); -$cmd = "$IDNGRAM2LM -idngram $IDNGRAM -vocab $VOCAB -arpa $LM -context $CCS -vocab_type 0 -good_turing -disc_ranges 0 0 0 -ascii_input"; -#$cmd = "$IDNGRAM2LM -idngram $IDNGRAM -vocab $VOCAB -arpa $LM -context $CCS -vocab_type 0 -absolute -ascii_input"; -#$cmd = "$IDNGRAM2LM -idngram $IDNGRAM -vocab $VOCAB -arpa $LM -context $CCS -vocab_type 0 -ascii_input"; -&say('compile', "$cmd$/"); -die "idngram2lm failed$/" if system($cmd); - -#get dictionary -&say('compile', 'compiling dictionary...'); -&getdict($DICT, $REDUCED_DICT, $VOCAB); -&say('compile', "done\n"); - -sub getcorpus { - my $corpusfile = shift; - #flatten grammar - open(ZAPGRA, $GRAMMARFILE) || die "Can't open grammar file$/"; - open(ZAPFLAT, ">$FLATGRAMMARFILE") || die "Can't open grammar flat file$/"; - print ZAPFLAT &flat(); - close ZAPGRA; - close ZAPFLAT; - - open(RANDOM, "$RANDOMSAMPS -n $SAMPSIZE -d $GRAMMARDIR|") || - die "Cannot execute $RANDOMSAMPS$/"; - open(CORPUS, ">$corpusfile") || die "Can't open $corpusfile$/"; - binmode CORPUS; - while () { - $_ = uc($_); - chomp; - s/<\/?S> //g; - print CORPUS " $_ \n"; - } - close CORPUS; -} - -sub getvocab { - my $basefile = shift; - my $vocab = shift; - my $ccs = shift; - open(VOCAB, ">$vocab") || die "Can't open $vocab$/"; - binmode VOCAB; - open(BASE, "<$basefile") || die "Can't open $basefile$/"; - my @base = map { /(.*) .*/? uc("$1\n"): () } ; - print VOCAB grep !/<\/?S>/, sort(@base); - print VOCAB "\n"; - print VOCAB "\n"; - close VOCAB; - open(CCS, ">$ccs") || die "Can't open $ccs$/"; - binmode CCS; - print CCS "\n"; - close CCS; -} - -sub getdict { - my $dict = shift; - my $reduced = shift; - my $vocab = shift; - my @long; - open(DICT, ">$dict") || die "Can't open $dict$/"; - binmode DICT; - open(REDUCED, ">$reduced") || die "Can't open $reduced$/"; - binmode REDUCED; - open(VOCAB, "<$vocab") || die "Can't open $vocab$/"; - for () { - s/=/_/g; - push @long, $_; - } - foreach (&shorten(@long)) { - s/_/=/g; - print DICT "$_\n"; - s/\bIX\b/AX/g; - print REDUCED "$_\n"; - } - close DICT; - close REDUCED; -} - -sub shorten { - open (OUTFILE, ">outfile.tmp"); - open (LONGFILE, ">longfile.tmp"); - - my $counter = 0; - my $not_done = 1; - my @listlongwords; - - foreach (@_) { - my @blah = split / /, $_; - for my $i (@blah) { - my $len = length $i; - if ($len >= 35) { - for my $m (@listlongwords) { - if ($m =~ /$i/) { - $not_done = 0; - } - } - - if ($not_done) { - push(@listlongwords, $i); - } - - $not_done = 1; - my @words = split /_/, $i; - for my $j (@words) { - print LONGFILE "$j "; - } - print LONGFILE "\n"; - } else { - print OUTFILE "$i "; - } - } - } - - close(OUTFILE); - close(LONGFILE); - - my @diclines = - grep !(/CONTENT-TYPE/ || /TEXT\/PLAIN/), &getdic('outfile.tmp'); - unlink 'outfile.tmp'; - my @longlines = stat('longfile.tmp')->size? - grep !(/CONTENT-TYPE/ || /TEXT\/PLAIN/), &getdic('longfile.tmp'): (); - unlink 'longfile.tmp'; - - my $not_used = 1; - - for my $i (@listlongwords) { - chomp $i; - my $lotsaphones = "$i "; - my @word_parts = split /_/, $i; - for my $word (@word_parts) { - $word =~ s/(\W)/\\$1/; - #warn "the word to look up is $word\n"; - for my $j (@longlines) { - if ($not_used) { - if ($j =~ /^$word\t/) { - my @pronounciation = split /\t/, $j; - chomp $pronounciation[1]; - $lotsaphones .= "$pronounciation[1] "; - $not_used = 0; - } - } - } - $not_used = 1; - } - $lotsaphones .= "\n"; - push @diclines, $lotsaphones; - } - return @diclines; -} - -sub getdic { - if ($#_ == -1) { - die "Need the corpus location as an argument\n"; - } - - my $ua = new LWP::UserAgent; - my $res = $ua->request(POST 'http://fife.speech.cs.cmu.edu/cgi-bin/tools/lmtool.2.pl', - Content_Type => 'form-data', - Content => [formtype => 'simple', - corpus => [$_[0]], - #handdict => undef, - #extrawords => undef, - #phoneset => '40', - #bracket => 'Yes', - #model => 'Bigram', - #class => 'nil', - #discount => '0.5', - submit => 'COMPILE KNOWLEDGE BASE']); - - my $result; - if ($res->is_success) { - $result = $res->content; - } else { - die "Couldn't execute the perl script, probably error in the form$/"; - } - - if ($result =~ /\!-- DIC.*ct\/\/(.*)\">/) { - - my $blah = "http://fife.speech.cs.cmu.edu/tools/product//$1"; - $res = $ua->request(GET $blah); - - if ($res->is_success) { - return split(/\n/, $res->content); - } else { - die "Can't find dictionary file$/"; - } - } else { - die "Couldn't parse the result: $result$/"; - } -} - -sub say { - print shift, ": ", shift, $/; -} - -sub flat { - my @unflat = @_; - my @result; - for (@unflat) { - if (!s/^\s*\((.*)\)/$1/) { - push @result, $_; - } else { - my @stack; - my %flathash; - push(@stack, [split]); - while (my $buffref = shift @stack) { - my $i = 0; - my @buff = @$buffref; - my $flat; - for (@buff) { - if (/^\*(.*)/) { - $flat .= "$1 "; - push(@stack, [ @buff[0..$i-1], @buff[$i+1..$#buff] ]); - } else { - $flat .= "$_ "; - } - $i++; - } - $flathash{$flat} = 1; - } - foreach (keys %flathash) { - push @result, "\t( $_)\n"; - } - } - } - @result; -} From tk at edam.speech.cs.cmu.edu Fri Apr 6 16:08:04 2007 From: tk at edam.speech.cs.cmu.edu (tk@edam.speech.cs.cmu.edu) Date: Fri, 6 Apr 2007 16:08:04 -0400 Subject: [RavenclawDev 243] [20] Tools/MakeLM: Added pronounce server and lexical data to make the dictionary generation stand-alone . Message-ID: <200704062008.l36K84EV005861@edam.speech.cs.cmu.edu> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/ravenclaw-developers/attachments/20070406/434e508f/attachment-0001.html -------------- next part -------------- Modified: Tools/MakeLM/generate_random_samples.pl =================================================================== --- Tools/MakeLM/generate_random_samples.pl 2007-04-05 14:29:08 UTC (rev 19) +++ Tools/MakeLM/generate_random_samples.pl 2007-04-06 20:08:03 UTC (rev 20) @@ -96,6 +96,10 @@ $clausi++; next; } +if($_ eq "-grammarfile") { +$grammarfile=shift; +next; +} die "Unrecognized command line option $_\nUse generate_random_samples -h for help\n"; } @@ -213,7 +217,7 @@ # $NAME=$_; # load_grammar_file("$NAME.gra"); #} -load_grammar_file('zap2flat.gra'); +load_grammar_file($grammarfile); if($nets{"noises"}) { foreach(@noise) { Added: Tools/MakeLM/lexdata/Hand_Optimized_Dictionary =================================================================== --- Tools/MakeLM/lexdata/Hand_Optimized_Dictionary (rev 0) +++ Tools/MakeLM/lexdata/Hand_Optimized_Dictionary 2007-04-06 20:08:03 UTC (rev 20) @@ -0,0 +1,72 @@ +BETCHA B EH CH AX +CARLOADS K AA R L OW D Z +CHARLOTTEVILLE SH AA R L AX T V IH L +CLOSEBY K L OW S B AY +CLOSEBY(2) K L OW Z B AY +CMU S IY EH M Y UW +CONGESTIONS K AX N JH EH S CH AX N Z +DANSVILLE D AE N Z V IH L +DANSVILLE'S D AE N Z V IH L Z +DOKEY D OW K IY +DURATIONS D UH R EY SH AX N Z +ENUNCIATE IY N AH N S IY EY TD +EXCUSING IX K S K Y UW Z IH NG +FRANKLINVILLE F R AE NG K L IX N V IH L +HM HH AH M +HMM HH AH M +HORNELL HH AO R N EH L +HYDERABAD HH AY D AX R AX B AE DD +IDENTICALLY AY D EH N T IH K L IY +IDENTICALLY(2) AY D EH N T IH K AX L IY +IMBECILE IH M B AX S AX L +KPH K EY P IY EY CH +KPHES K EY P IY EY CH AX Z +LIMOS L IH M OW Z +MALUSO M AX L UW S OW +MAROC M AA R AO KD +MGM EH M G IY EH M +MISUNDERSTANDS M IH S AX N D AXR S T AE N D Z +MM AH M +MONTEGO M AO N T IY G OW +MPH EH M P IY EY CH +MPHES EH M P IY EY CH AX Z +NONJET N AO N JH EH TD +NONTURBO N AO N T ER B OW +NONTURBOS N AO N T ER B OW Z +NY EH N W AY +NYC EH N W AY S IY +OJ OW JH EY +OPTIMIZED AA PD T AX M AY Z DD +OPTIMIZES AA PD T AX M AY Z IX Z +OPTIMIZING AA PD T AX M AY Z IX NG +PANAM P AE N AE M +PARSER P AA R S ER +PMS P IY EH M EH S +REFORMULATES R IY F AO R M Y AX L EY TS +REFORMULATING R IY F AO R M Y AX L EY DX IX NG +REROUTES R IY R UW TS +REROUTES(2) R IY R AW TS +RESPEAK R IY S P IY KD +RESTARTS R IY S T AA R TS +ROADIE R OW D IY +SODUS S OW D AH S +TANK'LL T AE NG K AX L +TANKERLOAD T AE NG K AXR L OW DD +TANKERLOADS T AE NG K AXR L OW D Z +TAXICABS T AE K S IY K AE B Z +THINGIES TH IH NG IY Z +THINGY TH IH NG IY +THOSE'LL DH OW Z AX L +TIMEWISE T AY M W AY Z +UNCOUPLE AH N K AH P AX L +UNDOES AH N D UW Z +UNDOES(2) AH N D AH Z +UNHITCH AH N HH IH CH +UNHOOK AH N HH UH KD +UNPRESSURIZED AH N P R EH SH AXR AY Z DD +UNSOLVABLE AH N S AA L V AX B AX L +WHICH'LL W IH CH AX L +YESTERDAYS Y EH S T AXR D EY Z + + + Added: Tools/MakeLM/lexdata/Normalizing_cmudict =================================================================== --- Tools/MakeLM/lexdata/Normalizing_cmudict (rev 0) +++ Tools/MakeLM/lexdata/Normalizing_cmudict 2007-04-06 20:08:03 UTC (rev 20) @@ -0,0 +1,28 @@ +How to normalize the cmu 100k dictionary +---------------------------------------- + + +From: Peter_Jansen at PJJ.DISCOVERY.CS.CMU.EDU + +Hello Alex, + +Yes, I have a program that does this conversion. It is in +/afs/cs/project/fgdata/DICT/pjj/new2sphinx . + +This script makes use of several sed scripts under the same directory +(described below). +It assumes that the file is in cmudict.0.1 format, for example + ABBREVIATED(2) AH0 B R IY1 V IY0 EY2 T IH0 D +(i.e., word in capitals, possibly with rank of this pronunciation in parens, + 2 blanks, and then phones separated by one blank.) + +Here is a brief description of the files I mentioned: +- to-flap-newX.sed adds flaps where appropriate, +- tsX.sed merges T followed by S into TS, +- deletableX.sed makes stops deletable where appropriate (TD, DD, ...), +- postmod2X.sed adds IX, AX and AXR, and finally +- postmodX.sed takes care of some special cases. + +Let me know if you have further questions, comments, or problems. + +-- Peter Added: Tools/MakeLM/lexdata/READ_ME =================================================================== --- Tools/MakeLM/lexdata/READ_ME (rev 0) +++ Tools/MakeLM/lexdata/READ_ME 2007-04-06 20:08:03 UTC (rev 20) @@ -0,0 +1,49 @@ +open source version +------------------- +[20000711] (air) + +cmudict.0.6d_SPHINX_NEW uses the "new" phoneset (sans deletables, etc) +it was compiled on alf9, where the mod'd rules currently arer. This all +needs to be consolidated eventually. + +cmudict.0.6d is still effectively the most recent version of the dict, +even if dating to 1997/98. + +SphinxPhones_51 - original phone set (51 phones) +SphinxPhones_44 - original phone set (44 phones; w/o delatables, TS) + +bindings: +Current_Dictionary -> SphinxPhones_51 +Current_Dictionary_NEW -> SphinxPhones_44 + + + +------------------------------------------------------------------------- +[old READ_ME (from 1993)] + + +Lexical databases for the pronounce program +------------------------------------------- + +all_v2.dict Carnegie Mellon's 32k entry pronunciation dictionary for WSJ. +cmudict_1.0a The Carnegie Mellon 100k dictionary. + This file should be periodically updated to the latest version. + +lexicon.data Morph and exception databases used by the Decomp module. +lexicon.key +nslex.900 +nslex.901 + +ltosru.bin letter to sound rules used by the Sound2 module. + + +Sources +------- + +cmudict_1.0a +/afs/cs/project/fgdata/ftp/dict/cmudict.0.1 processed +by Peter Jansen's sphinx normalization code. +(see separate note.) + +all_v2.dict +mei-Yuh training dictionary Added: Tools/MakeLM/lexdata/SphinxNoiseSet =================================================================== --- Tools/MakeLM/lexdata/SphinxNoiseSet (rev 0) +++ Tools/MakeLM/lexdata/SphinxNoiseSet 2007-04-06 20:08:03 UTC (rev 20) @@ -0,0 +1,17 @@ ++AH+ ++BACKGROUND+ ++CLICK+ ++COUGH+ ++ENGD+ ++ER+ ++EXHALE+ ++GROUCH+ ++LAUGHTER+ ++MM+ ++MMHUM+ ++NOISE+ ++OH+ ++SQUEAK+ ++UH+ ++UHUM+ ++UM+ Added: Tools/MakeLM/lexdata/SphinxPhoneSet =================================================================== --- Tools/MakeLM/lexdata/SphinxPhoneSet (rev 0) +++ Tools/MakeLM/lexdata/SphinxPhoneSet 2007-04-06 20:08:03 UTC (rev 20) @@ -0,0 +1,51 @@ +AA +AE +AH +AO +AW +AX +AXR +AY +B +BD +CH +D +DD +DH +DX +EH +ER +EY +F +G +GD +HH +IH +IX +IY +JH +K +KD +L +M +N +NG +OW +OY +P +PD +R +S +SH +SIL +T +TD +TH +TS +UH +UW +V +W +Y +Z +ZH Added: Tools/MakeLM/lexdata/SphinxPhones_44 =================================================================== --- Tools/MakeLM/lexdata/SphinxPhones_44 (rev 0) +++ Tools/MakeLM/lexdata/SphinxPhones_44 2007-04-06 20:08:03 UTC (rev 20) @@ -0,0 +1,44 @@ +AA +AE +AH +AO +AW +AX +AXR +AY +B +CH +D +DH +DX +EH +ER +EY +F +G +HH +IH +IX +IY +JH +K +L +M +N +NG +OW +OY +P +R +S +SH +SIL +T +TH +UH +UW +V +W +Y +Z +ZH Added: Tools/MakeLM/lexdata/SphinxPhones_51 =================================================================== --- Tools/MakeLM/lexdata/SphinxPhones_51 (rev 0) +++ Tools/MakeLM/lexdata/SphinxPhones_51 2007-04-06 20:08:03 UTC (rev 20) @@ -0,0 +1,51 @@ +AA +AE +AH +AO +AW +AX +AXR +AY +B +BD +CH +D +DD +DH +DX +EH +ER +EY +F +G +GD +HH +IH +IX +IY +JH +K +KD +L +M +N +NG +OW +OY +P +PD +R +S +SH +SIL +T +TD +TH +TS +UH +UW +V +W +Y +Z +ZH Added: Tools/MakeLM/lexdata/cmudict.0.6d_SPHINX_NEW =================================================================== --- Tools/MakeLM/lexdata/cmudict.0.6d_SPHINX_NEW (rev 0) +++ Tools/MakeLM/lexdata/cmudict.0.6d_SPHINX_NEW 2007-04-06 20:08:03 UTC (rev 20) @@ -0,0 +1,129205 @@ +!EXCLAMATION-POINT EH K S K L AX M EY SH AX N P OY N T +"CLOSE-QUOTE K L OW Z K W OW T +"DOUBLE-QUOTE D AH B AX L K W OW T +"END-OF-QUOTE EH N D AX V K W OW T +"END-QUOTE EH N D K W OW T +"IN-QUOTES IH N K W OW T S +"QUOTE K W OW T +"UNQUOTE AH N K W OW T +#SHARP-SIGN SH AA R P S AY N +%PERCENT P AXR S EH N T +&ERSAND AE M P AXR S AE N D +'CAUSE K AX Z +'COURSE K AO R S +'EM AX M +'END-INNER-QUOTE EH N D IH N AXR K W OW T +'END-QUOTE EH N D K W OW T +'INNER-QUOTE IH N AXR K W OW T +'M AX M +'N AX N +'QUOTE K W OW T +'S EH S +'SINGLE-QUOTE S IH NG G AX L K W OW T +'TIL T IH L +'TIS T IH Z +'TWAS T W AH Z +(BEGIN-PARENS B IX G IH N P AXR EH N Z +(IN-PARENTHESES IH N P AXR EH N TH AX S IY Z +(LEFT-PAREN L EH F T P AXR EH N +(OPEN-PARENTHESES OW P AX N P AXR EH N TH AX S IY Z +(PAREN P AXR EH N +(PARENS P AXR EH N Z +(PARENTHESES P AXR EH N TH AX S IY Z +)CLOSE-PAREN K L OW Z P AXR EH N +)CLOSE-PARENTHESES K L OW Z P AXR EH N TH AX S IY Z +)END-PAREN EH N D P AXR EH N +)END-PARENS EH N D P AXR EH N Z +)END-PARENTHESES EH N D P AXR EH N TH AX S IY Z +)END-THE-PAREN EH N D DH AX P AXR EH N +)PAREN P AXR EH N +)PARENS P AXR EH N Z +)RIGHT-PAREN R AY T P AXR EH N +)RIGHT-PAREN(2) R AY T P EH R AX N +)UN-PARENTHESES AH N P AXR EH N TH AX S IY Z +,COMMA K AA M AX +-DASH D AE SH +-HYPHEN HH AY F AX N +...ELLIPSIS IX L IH P S IX S +.DECIMAL D EH S AX M AX L +.DOT D AA T +.FULL-STOP F UH L S T AA P +.PERIOD P IH R IY AX D +.POINT P OY N T +/SLASH S L AE SH +:COLON K OW L AX N +;SEMI-COLON S EH M IX K OW L AX N +;SEMI-COLON(2) S EH M IY K OW L AX N +?QUESTION-MARK K W EH S CH AX N M AA R K +A AX +A'S EY Z +A(2) EY +A. EY +A.'S EY Z +A.S EY Z +A42128 EY F AO R T UW W AH N T UW EY T +AAA T R IH P AX L EY +AABERG AA B AXR G +AACHEN AA K AX N +AAKER AA K AXR +AALSETH AA L S EH TH +AAMODT AA M AX T +AANCOR AA N K AO R +AARDEMA AA R D EH M AX +AARDVARK AA R D V AA R K +AARON EH R AX N +AARON'S EH R AX N Z +AARONS EH R AX N Z +AARONSON AA R AX N S AX N +AARONSON'S AA R AX N S AX N Z +AARONSON'S(2) EH R AX N S AX N Z +AARONSON(2) EH R AX N S AX N +AARTI AA R T IY +AASE AA S +AASEN AA S AX N +AB AE B +AB(2) EY B IY +ABABA AA B AX B AX +ABABA(2) AX B AA B AX +ABACHA AE B AX K AX +ABACK AX B AE K +ABACO AE B AX K OW +ABACUS AE B AX K AX S +ABAD AX B AA D +ABADAKA AX B AE DX AX K AX +ABADI AX B AE DX IY +ABADIE AX B AE DX IY +ABAIR AX B EH R +ABALKIN AX B AA L K IX N +ABALONE AE B AX L OW N IY +ABALOS AA B AA L OW Z +ABANDON AX B AE N D AX N +ABANDONED AX B AE N D AX N D +ABANDONING AX B AE N D AX N IX NG +ABANDONMENT AX B AE N D AX N M AX N T +ABANDONMENTS AX B AE N D AX N M AX N T S +ABANDONS AX B AE N D AX N Z +ABANTO AX B AE N T OW +ABARCA AX B AA R K AX +ABARE AA B AA R IY +ABASCAL AE B AX S K AX L +ABASH AX B AE SH +ABASHED AX B AE SH T +ABATE AX B EY T +ABATED AX B EY DX IX D +ABATEMENT AX B EY T M AX N T +ABATEMENTS AX B EY T M AX N T S +ABATES AX B EY T S +ABATING AX B EY DX IX NG +ABBA AE B AX +ABBADO AX B AA DX OW +ABBAS AX B AA S +ABBASI AA B AA S IY +ABBATE AA B EY T +ABBATIELLO AA B AA DX IY EH L OW +ABBE AE B EY +ABBE(2) AE B IY +ABBENHAUS AE B AX N HH AW S +ABBETT AX B EH T +ABBEVILLE AE B V IX L +ABBEY AE B IY +ABBEY'S AE B IY Z +ABBIE AE B IY +ABBITT AE B IX T +ABBOT AE B AX T +ABBOTT AE B AX T +ABBOTT'S AE B AX T S +ABBOUD AX B AW D +ABBOUD(2) AX B UW D +ABBREVIATE AX B R IY V IY EY T +ABBREVIATED AX B R IY V IY EY DX AX D +ABBREVIATED(2) AX B R IY V IY EY DX IX D +ABBREVIATES AX B R IY V IY EY T S +ABBREVIATING AX B R IY V IY EY DX IX NG +ABBREVIATION AX B R IY V IY EY SH AX N +ABBREVIATIONS AX B R IY V IY EY SH AX N Z +ABBRUZZESE AA B R UW T S EY Z IY +ABBS AE B Z +ABBY AE B IY +ABCO AE B K OW +ABCOTEK AE B K OW T EH K +ABDALLA AE B D AE L AX +ABDALLAH AE B D AE L AX +ABDEL AE B D EH L +ABDELLA AE B D EH L AX +ABDICATE AE B D AX K EY T +ABDICATED AE B D AX K EY DX AX D +ABDICATES AE B D AX K EY T S +ABDICATING AE B D IX K EY DX IX NG +ABDICATION AE B D IX K EY SH AX N +ABDNOR AE B D N AXR +ABDO AE B D OW +ABDOLLAH AE B D AA L AX +ABDOMEN AE B D AX M AX N +ABDOMEN(2) AE B D OW M AX N +ABDOMINAL AE B D AA M AX N AX L +ABDOMINAL(2) AX B D AA M AX N AX L +ABDUCT AE B D AH K T +ABDUCTED AE B D AH K T IX D +ABDUCTED(2) AX B D AH K T IX D +ABDUCTEE AE B D AH K T IY +ABDUCTEES AE B D AH K T IY Z +ABDUCTING AE B D AH K T IX NG +ABDUCTING(2) AX B D AH K T IX NG +ABDUCTION AE B D AH K SH AX N +ABDUCTION(2) AX B D AH K SH AX N +ABDUCTIONS AE B D AH K SH AX N Z +ABDUCTIONS(2) AX B D AH K SH AX N Z +ABDUCTOR AE B D AH K T AXR +ABDUCTOR(2) AX B D AH K T AXR +ABDUCTORS AE B D AH K T AXR Z +ABDUCTORS(2) AX B D AH K T AXR Z +ABDUCTS AE B D AH K T S +ABDUL AE B D UW L +ABDULAZIZ AE B D UW L AX Z IY Z +ABDULLA AA B D UW L AX +ABDULLAH AE B D AH L AX +ABE EY B +ABED AX B EH D +ABEDI AX B EH DX IY +ABEE AX B IY +ABEL EY B AX L +ABELA AA B EH L AX +ABELARD AE B IX L AXR D +ABELE AX B IY L +ABELES AX B IY L Z +ABELES(2) EY B AX L IY Z +ABELL EY B AX L +ABELLA AX B EH L AX +ABELN AE B IX L N +ABELOW AE B AX L OW +ABELS EY B AX L Z +ABELSON AE B IX L S AX N +ABEND AE B EH N D +ABEND(2) AX B EH N D +ABENDROTH AE B IX N D R AO TH +ABER EY B AXR +ABERCROMBIE AE B AXR K R AA M B IY +ABERDEEN AE B AXR D IY N +ABERFORD EY B AXR F AXR D +ABERG AE B AXR G +ABERLE AE B AXR AX L +ABERLE(2) AE B AXR L +ABERMIN AE B AXR M IX N +ABERNATHY AE B AXR N AE TH IY +ABERNETHY AE B AXR N EH TH IY +ABERRANT AE B EH R AX N T +ABERRATION AE B AXR EY SH AX N +ABERRATIONAL AE B AXR EY SH AX N AX L +ABERRATIONS AE B AXR EY SH AX N Z +ABERT AE B AXR T +ABET AX B EH T +ABETTED AX B EH DX IX D +ABETTING AX B EH DX IX NG +ABEX EY B EH K S +ABEYANCE AX B EY AX N S +ABEYTA AA B EY DX AX +ABHOR AE B HH AO R +ABHORRED AX B HH AO R D +ABHORRENCE AX B HH AO R AX N S +ABHORRENT AE B HH AO R AX N T +ABHORS AX B HH AO R Z +ABID EY B IX D +ABIDE AX B AY D +ABIDED AX B AY DX IX D +ABIDES AX B AY D Z +ABIDING AX B AY DX IX NG +ABIE AE B IY +ABIGAIL AE B AX G EY L +ABILA AA B IY L AX +ABILENE AE B IX L IY N +ABILITIES AX B IH L AX DX IY Z +ABILITY AX B IH L AX DX IY +ABINGTON AE B IX NG T AX N +ABIO AA B IY OW +ABIOLA AA B IY OW L AX +ABIOLA'S AA B IY OW L AX Z +ABIOMED EY B IY AX M EH D +ABITIBI AE B IX T IY B IY +ABITZ AE B IX T S +ABJECT AE B JH EH K T +ABKHAZIA AE B K HH AA Z Y AX +ABKHAZIA(2) AE B K HH AE Z Y AX +ABKHAZIAN AE B K HH AA Z IY AX N +ABKHAZIAN(2) AE B K HH AA Z Y AX N +ABKHAZIAN(3) AE B K HH AE Z IY AX N +ABKHAZIAN(4) AE B K HH AE Z Y AX N +ABKHAZIANS AE B K HH AA Z IY AX N Z +ABKHAZIANS(2) AE B K HH AE Z IY AX N Z +ABLAZE AX B L EY Z +ABLE EY B AX L +ABLED EY B AX L D +ABLER EY B AX L AXR +ABLER(2) EY B L AXR +ABLES EY B AX L Z +ABLEST EY B AX L S T +ABLEST(2) EY B L AX S T +ABLOOM AX B L UW M +ABLY EY B L IY +ABNER AE B N AXR +ABNEY AE B N IY +ABNORMAL AE B N AO R M AX L +ABNORMALITIES AE B N AO R M AE L AX DX IY Z +ABNORMALITY AE B N AO R M AE L AX DX IY +ABNORMALLY AE B N AO R M AX L IY +ABO AA B OW +ABO'S AA B OW Z +ABOARD AX B AO R D +ABODE AX B OW D +ABOLISH AX B AA L IX SH +ABOLISHED AX B AA L IX SH T +ABOLISHES AX B AA L IX SH IX Z +ABOLISHING AX B AA L IX SH IX NG +ABOLITION AE B AX L IH SH AX N +ABOLITIONISM AE B AX L IH SH AX N IH Z AX M +ABOLITIONIST AE B AX L IH SH AX N AX S T +ABOLITIONISTS AE B AX L IH SH AX N AX S +ABOLITIONISTS(2) AE B AX L IH SH AX N AX S S +ABOLITIONISTS(3) AE B AX L IH SH AX N AX S T S +ABOMINABLE AX B AA M AX N AX B AX L +ABOMINATION AX B AA M AX N EY SH AX N +ABOOD AX B UW D +ABOODI AX B UW DX IY +ABORIGINAL AE B AXR IH JH AX N AX L +ABORIGINE AE B AXR IH JH AX N IY +ABORIGINES AE B AXR IH JH AX N IY Z +ABORN AX B AO R N +ABORT AX B AO R T +ABORTED AX B AO R DX IX D +ABORTIFACIENT AX B AO R DX AX F EY SH AX N T +ABORTIFACIENTS AX B AO R DX AX F EY SH AX N T S +ABORTING AX B AO R DX IX NG +ABORTION AX B AO R SH AX N +ABORTIONIST AX B AO R SH AX N IX S T +ABORTIONISTS AX B AO R SH AX N IX S +ABORTIONISTS(2) AX B AO R SH AX N IX S S +ABORTIONISTS(3) AX B AO R SH AX N IX S T S +ABORTIONS AX B AO R SH AX N Z +ABORTIVE AX B AO R DX IX V +ABOTT AX B AA T +ABOU AX B UW +ABOUD AA B UW D +ABOUHALIMA AA B UW HH AA L IY M AX +ABOUHALIMA'S AA B UW HH AA L IY M AX Z +ABOUND AX B AW N D +ABOUNDED AX B AW N D IX D +ABOUNDING AX B AW N D IX NG +ABOUNDS AX B AW N D Z +ABOUT AX B AW T +ABOUT'S AX B AW T S +ABOVE AX B AH V +ABOVE'S AX B AH V Z +ABOVEBOARD AX B AH V B AO R D +ABPLANALP AE B P L AX N AE L P +ABRA AA B R AX +ABRACADABRA AE B R AX K AX D AE B R AX +ABRAHAM EY B R AX HH AE M +ABRAHAMIAN AE B R AX HH EY M IY AX N +ABRAHAMS EY B R AX HH AE M Z +ABRAHAMSEN AE B R AX HH AE M S AX N +ABRAHAMSON AX B R AE HH AX M S AX N +ABRAM AX B R AE M +ABRAMCZYK AA B R AX M CH IX K +ABRAMO AA B R AA M OW +ABRAMOVITZ AX B R AA M AX V IX T S +ABRAMOWICZ AX B R AA M AX V IX CH +ABRAMOWITZ AX B R AA M AX W IX T S +ABRAMS EY B R AX M Z +ABRAMSON EY B R AX M S AX N +ABRASION AX B R EY ZH AX N +ABRASIONS AX B R EY ZH AX N Z +ABRASIVE AX B R EY S IX V +ABRASIVES AX B R EY S IX V Z +ABREAST AX B R EH S T +ABREGO AA B R EH G OW +ABREU AX B R UW +ABRIDGE AX B R IH JH +ABRIDGED AX B R IH JH D +ABRIL AX B R IH L +ABROAD AX B R AO D +ABROGATE AE B R AX G EY T +ABROGATED AE B R AX G EY DX IX D +ABROGATING AE B R AX G EY DX IX NG +ABROGATION AE B R AX G EY SH AX N +ABRON AX B R AA N +ABRUPT AX B R AH P T +ABRUPTLY AX B R AH P T L IY +ABRUPTNESS AX B R AH P T N AX S +ABRUTYN EY B R UW T IX N +ABRUZZESE AA B R UW T S EY Z IY +ABRUZZO AA B R UW Z OW +ABS AE B Z +ABS(2) EY B IY EH S +ABSALOM AE B S AX L AX M +ABSCAM AE B S K AE M +ABSCESS AE B S EH S +ABSENCE AE B S AX N S +ABSENCES AE B S AX N S IX Z +ABSENT AE B S AX N T +ABSENTEE AE B S AX N T IY +ABSENTEEISM AE B S AX N T IY IX Z AX M +ABSENTEES AE B S AX N T IY Z +ABSENTIA AE B S EH N SH AX +ABSHER AE B SH AXR +ABSHIER AE B SH IY AXR +ABSHIRE AE B SH AY R +ABSO AE B S OW +ABSOLOM AE B S AX L AX M +ABSOLUT AE B S AX L UW T +ABSOLUTE AE B S AX L UW T +ABSOLUTELY AE B S AX L UW T L IY +ABSOLUTENESS AE B S AX L UW T N AX S +ABSOLUTES AE B S AX L UW T S +ABSOLUTION AE B S AX L UW SH AX N +ABSOLUTISM AE B S AX L UW T IH Z AX M +ABSOLUTIST AE B S IX L UW DX IX S T +ABSOLVE AE B Z AA L V +ABSOLVE(2) AX B Z AA L V +ABSOLVED AE B Z AA L V D +ABSOLVED(2) AX B Z AA L V D +ABSOLVES AE B Z AA L V Z +ABSOLVES(2) AX B Z AA L V Z +ABSOLVING AE B Z AA L V IX NG +ABSOLVING(2) AX B Z AA L V IX NG +ABSORB AX B Z AO R B +ABSORBED AX B Z AO R B D +ABSORBENCY AX B Z AO R B AX N S IY +ABSORBENT AX B Z AO R B AX N T +ABSORBER AX B Z AO R B AXR +ABSORBERS AX B Z AO R B AXR Z +ABSORBING AX B Z AO R B IX NG +ABSORBS AX B Z AO R B Z +ABSORPTION AX B S AO R P SH AX N +ABSORPTION(2) AX B Z AO R P SH AX N +ABSTAIN AE B S T EY N +ABSTAIN(2) AX B S T EY N +ABSTAINED AE B S T EY N D +ABSTAINED(2) AX B S T EY N D +ABSTAINING AE B S T EY N IX NG +ABSTAINING(2) AX B S T EY N IX NG +ABSTENTION AE B S T EH N CH AX N +ABSTENTION(2) AX B S T EH N CH AX N +ABSTENTIONS AE B S T EH N CH AX N Z +ABSTENTIONS(2) AX B S T EH N CH AX N Z +ABSTINENCE AE B S T AX N AX N S +ABSTINENT AE B S T AX N AX N T +ABSTON AE B S T AX N +ABSTRACT AE B S T R AE K T +ABSTRACTED AE B S T R AE K T IX D +ABSTRACTION AE B S T R AE K SH AX N +ABSTRACTIONS AE B S T R AE K SH AX N Z +ABSTRACTS AE B S T R AE K T S +ABSTRUSE AX B S T R UW S +ABSURD AX B S ER D +ABSURDIST AX B S ER DX IX S T +ABSURDITIES AX B S ER DX AX DX IY Z +ABSURDITY AX B S ER DX AX DX IY +ABSURDLY AX B S ER D L IY +ABT AE B T +ABT(2) EY B IY T IY +ABTS AE B T S +ABTS(2) EY B IY T IY EH S +ABTS(3) EY B IY T IY Z +ABU AE B UW +ABUDRAHM AX B AH D R AX M +ABULADZE AE B Y UW L AE D Z IY +ABUNDANCE AX B AH N D AX N S +ABUNDANT AX B AH N D AX N T +ABUNDANTLY AX B AH N D AX N T L IY +ABURTO AX B UH R T OW +ABURTO'S AX B UH R T OW Z +ABUSE AX B Y UW S +ABUSE(2) AX B Y UW Z +ABUSED AX B Y UW Z D +ABUSER AX B Y UW Z AXR +ABUSERS AX B Y UW Z AXR Z +ABUSES AX B Y UW S IX Z +ABUSES(2) AX B Y UW Z IX Z +ABUSING AX B Y UW Z IX NG +ABUSIVE AX B Y UW S IX V +ABUT AX B AH T +ABUTS AX B AH T S +ABUTTED AX B AH DX AX D +ABUTTING AX B AH DX IX NG +ABUZZ AX B AH Z +ABYSMAL AX B IH Z M AX L +ABYSMALLY AX B IH Z M AX L IY +ABYSS AX B IH S +ABZUG AE B Z AH G +ABZUG(2) AE B Z UH G +AC EY S IY +ACA AE K AX +ACACIA AX K EY SH AX +ACADEME AE K AX D IY M +ACADEMIA AE K AX D IY M IY AX +ACADEMIC AE K AX D EH M IX K +ACADEMICALLY AE K AX D EH M IX K L IY +ACADEMICIAN AE K AX DX AX M IH SH AX N +ACADEMICIANS AE K AX DX AX M IH SH AX N Z +ACADEMICIANS(2) AX K AE DX AX M IH SH AX N Z +ACADEMICS AE K AX D EH M IX K S +ACADEMIES AX K AE DX AX M IY Z +ACADEMY AX K AE DX AX M IY +ACADEMY'S AX K AE DX AX M IY Z +ACADIA AX K EY DX IY AX +ACAMPORA AX K AE M P AXR AX +ACANTHA AA K AA N DH AX +ACAPULCO AE K AX P UH L K OW +ACCARDI AA K AA R DX IY +ACCARDO AA K AA R DX OW +ACCEDE AE K S IY D +ACCEDED AE K S IY DX IX D +ACCEDES AE K S IY D Z +ACCEDING AE K S IY DX IX NG +ACCEL AX K S EH L +ACCELERANT AE K S EH L AXR AX N T +ACCELERANTS AE K S EH L AXR AX N T S +ACCELERATE AE K S EH L AXR EY T +ACCELERATED AE K S EH L AXR EY DX IX D +ACCELERATES AE K S EH L AXR EY T S +ACCELERATING AE K S EH L AXR EY DX IX NG +ACCELERATION AE K S EH L AXR EY SH AX N +ACCELERATOR AE K S EH L AXR EY DX AXR +ACCELEROMETER AE K S EH L AXR AA M AX DX AXR +ACCELEROMETERS AE K S EH L AXR AA M AX DX AXR Z +ACCENT AE K S EH N T +ACCENT(2) AX K S EH N T +ACCENTED AE K S EH N T IX D +ACCENTING AE K S EH N T IX NG +ACCENTS AE K S EH N T S +ACCENTUATE AE K S EH N CH UW EY T +ACCENTUATED AE K S EH N CH AX W EY DX IX D +ACCENTUATES AE K S EH N CH UW EY T S +ACCENTUATING AE K S EH N CH AX W EY DX IX NG +ACCEPT AE K S EH P T +ACCEPT(2) AX K S EH P T +ACCEPTABILITY AX K S EH P T AX B IH L AX DX IY +ACCEPTABLE AE K S EH P T AX B AX L +ACCEPTABLE(2) AX K S EH P T AX B AX L +ACCEPTANCE AE K S EH P T AX N S +ACCEPTANCE(2) AX K S EH P T AX N S +ACCEPTANCES AE K S EH P T AX N S IX Z +ACCEPTED AE K S EH P T IX D +ACCEPTED(2) AX K S EH P T AX D +ACCEPTING AE K S EH P T IX NG +ACCEPTING(2) AX K S EH P T IX NG +ACCEPTS AE K S EH P T S +ACCESS AE K S EH S +ACCESSED AE K S EH S T +ACCESSIBILITY AE K S EH S AX B IH L IX DX IY +ACCESSIBLE AE K S EH S AX B AX L +ACCESSING AE K S EH S IX NG +ACCESSION AX K S EH SH AX N +ACCESSORIES AE K S EH S AXR IY Z +ACCESSORIZE AE K S EH S AXR AY Z +ACCESSORIZED AE K S EH S AXR AY Z D +ACCESSORY AE K S EH S AXR IY +ACCETTA AA CH EH DX AX +ACCIDENT AE K S AX D AX N T +ACCIDENT'S AE K S AX D AX N T S +ACCIDENTAL AE K S AX D EH N AX L +ACCIDENTAL(2) AE K S AX D EH N T AX L +ACCIDENTALLY AE K S AX D EH N AX L IY +ACCIDENTALLY(2) AE K S AX D EH N T AX L IY +ACCIDENTLY AE K S AX D AX N T L IY +ACCIDENTS AE K S AX D AX N T S +ACCION AE CH IY AX N +ACCIVAL AE S IX V AA L +ACCLAIM AX K L EY M +ACCLAIMED AX K L EY M D +ACCLAIMING AX K L EY M IX NG +ACCLIMATE AE K L AX M EY T +ACCLIMATED AE K L AX M EY DX IX D +ACCLIMATION AE K L AX M EY SH AX N +ACCO AE K OW +ACCOLA AA K OW L AX +ACCOLADE AE K AX L EY D +ACCOLADES AE K AX L EY D Z +ACCOMANDO AA K OW M AA N D OW +ACCOMMODATE AX K AA M AX D EY T +ACCOMMODATED AX K AA M AX D EY DX AX D +ACCOMMODATES AX K AA M AX D EY T S +ACCOMMODATING AX K AA M AX D EY DX IX NG +ACCOMMODATION AX K AA M AX D EY SH AX N +ACCOMMODATIONS AX K AA M AX D EY SH AX N Z +ACCOMMODATIVE AX K AA M AX D EY DX IX V +ACCOMPANIED AX K AH M P AX N IY D +ACCOMPANIES AX K AH M P AX N IY Z +ACCOMPANIMENT AX K AH M P N IX M AX N T +ACCOMPANIMENT(2) AX K AH M P N IY M AX N T +ACCOMPANIMENTS AX K AH M P N IX M AX N T S +ACCOMPANIMENTS(2) AX K AH M P N IY M AX N T S +ACCOMPANIST AX K AH M P AX N AX S T +ACCOMPANY AX K AH M P AX N IY +ACCOMPANYING AX K AH M P AX N IY IX NG +ACCOMPLI AA K AA M P L IY +ACCOMPLI(2) AX K AA M P L IY +ACCOMPLICE AX K AA M P L AX S +ACCOMPLICES AX K AA M P L AX S AX Z +ACCOMPLISH AX K AA M P L IX SH +ACCOMPLISHED AX K AA M P L IX SH T +ACCOMPLISHES AX K AA M P L IX SH IX Z +ACCOMPLISHING AX K AA M P L IX SH IX NG +ACCOMPLISHMENT AX K AA M P L IX SH M AX N T +ACCOMPLISHMENTS AX K AA M P L IX SH M AX N T S +ACCOR AE K AO R +ACCOR'S AE K AXR Z +ACCORD AX K AO R D +ACCORD'S AX K AO R D Z +ACCORDANCE AX K AO R D AX N S +ACCORDED AX K AO R DX IX D +ACCORDING AX K AO R DX IX NG +ACCORDINGLY AX K AO R DX IX NG L IY +ACCORDION AX K AO R DX IY AX N +ACCORDIONS AX K AO R DX IY AX N Z +ACCORDS AX K AO R D Z +ACCOST AX K AO S T +ACCOSTED AX K AA S T AX D +ACCOSTING AX K AA S T IX NG +ACCOUNT AX K AW N T +ACCOUNT'S AX K AW N T S +ACCOUNTABILITY AX K AW N AX B IX L IX DX IY +ACCOUNTABILITY(2) AX K AW N T AX B IX L IX DX IY +ACCOUNTABLE AX K AW N AX B AX L +ACCOUNTABLE(2) AX K AW N T AX B AX L +ACCOUNTANCY AX K AW N T AX N S IY +ACCOUNTANT AX K AW N T AX N T +ACCOUNTANT'S AX K AW N T AX N T S +ACCOUNTANTS AX K AW N T AX N T S +ACCOUNTANTS' AX K AW N T AX N T S +ACCOUNTED AX K AW N AX D +ACCOUNTED(2) AX K AW N T AX D +ACCOUNTEMP AX K AW N T EH M P +ACCOUNTEMPS AX K AW N T EH M P S +ACCOUNTING AX K AW N IX NG +ACCOUNTING(2) AX K AW N T IX NG +ACCOUNTS AX K AW N T S +ACCOUTERMENT AX K UW DX AXR M AX N T +ACCOUTERMENTS AX K UW DX AXR M AX N T S +ACCREDIT AX K R EH DX AX T +ACCREDITATION AX K R EH DX AX T EY SH AX N +ACCREDITATIONS AX K R EH DX AX D EY SH AX N Z +ACCREDITED AX K R EH DX IX DX IX D +ACCREDITING AX K R EH DX AX DX IX NG +ACCRETION AX K R IY SH AX N +ACCRUAL AX K R UW AX L +ACCRUALS AX K R UW AX L Z +ACCRUE AX K R UW +ACCRUED AX K R UW D +ACCRUES AX K R UW Z +ACCRUING AX K R UW IX NG +ACCUMULATE AX K Y UW M Y AX L EY T +ACCUMULATED AX K Y UW M Y AX L EY DX IX D +ACCUMULATES AX K Y UW M Y AX L EY T S +ACCUMULATING AX K Y UW M Y AX L EY DX IX NG +ACCUMULATION AX K Y UW M Y AX L EY SH AX N +ACCUMULATIONS AX K Y UW M Y AX L EY SH AX N Z +ACCUMULATIVE AX K Y UW M Y AX L EY DX IX V +ACCUMULATIVELY AX K Y UW M Y AX L AX DX IX V L IY +ACCUMULATIVELY(2) AX K Y UW M Y AX L EY DX IX V L IY +ACCUMULATOR AX K Y UW M Y AX L EY DX AXR +ACCUMULATORS AX K Y UW M Y AX L EY DX AXR Z +ACCURACIES AE K Y AXR AX S IY Z +ACCURACY AE K Y AXR AX S IY +ACCURATE AE K Y AXR AX T +ACCURATELY AE K Y AXR AX T L IY +ACCURAY AE K Y AXR EY +ACCURAY'S AE K Y AXR EY Z +ACCURIDE AE K Y AXR AY D +ACCURSO AA K UH R S OW +ACCUSATION AE K Y AX Z EY SH AX N +ACCUSATION(2) AE K Y UW Z EY SH AX N +ACCUSATIONS AE K Y AX Z EY SH AX N Z +ACCUSATIONS(2) AE K Y UW Z EY SH AX N Z +ACCUSATIVE AX K Y UW Z AX DX IX V +ACCUSATORY AX K Y UW Z AX T AO R IY +ACCUSE AX K Y UW Z +ACCUSED AX K Y UW Z D +ACCUSER AX K Y UW Z AXR +ACCUSERS AX K Y UW Z AXR Z +ACCUSES AX K Y UW Z IX Z +ACCUSING AX K Y UW Z IX NG +ACCUSINGLY AX K Y UW Z IX NG L IY +ACCUSTOM AX K AH S T AX M +ACCUSTOMED AX K AH S T AX M D +ACCUTANE AE K Y UW T EY N +ACE EY S +ACED EY S T +ACER EY S AXR +ACERBIC AX S EH R B IX K +ACERO AX S EH R OW +ACERRA AX S EH R AX +ACES EY S IX Z +ACETAMINOPHEN AX S IY DX AX M IH N AX F AX N +ACETATE AE S AX T EY T +ACETIC AX S EH DX IX K +ACETIC(2) AX S IY DX IX K +ACETO AA S EH DX OW +ACETONE AE S AX T OW N +ACETYLCHOLINE AX S EH DX AX L K OW L IY N +ACETYLCHOLINE(2) AX S IY DX AX L K OW L IY N +ACETYLENE AX S EH DX AX L IY N +ACEVEDO AE S AX V EY DX OW +ACEVES AA S EY V EH S +ACEY EY S IY +ACHATZ AE K AX T S +ACHE EY K +ACHEBE AA CH EY B IY +ACHEE AX CH IY +ACHENBACH AE K IX N B AA K +ACHENBAUM AE K AX N B AW M +ACHES EY K S +ACHESON AE CH AX S AX N +ACHEY AE CH IY +ACHIEVABLE AX CH IY V AX B AX L +ACHIEVE AX CH IY V +ACHIEVED AX CH IY V D +ACHIEVEMENT AX CH IY V M AX N T +ACHIEVEMENTS AX CH IY V M AX N T S +ACHIEVER AX CH IY V AXR +ACHIEVERS AX CH IY V AXR Z +ACHIEVES AX CH IY V Z +ACHIEVING AX CH IY V IX NG +ACHILLE AX K IH L IY +ACHILLES AX K IH L IY Z +ACHILLES' AX K IH L IY Z +ACHING EY K IX NG +ACHMED AA HH M EH D +ACHOA AX CH OW AX +ACHOA'S AX CH OW AX Z +ACHOR EY K AXR +ACHORD AE K AO R D +ACHORN AE K AXR N +ACHTENBERG AE K T EH N B AXR G +ACHTERBERG AE K T AXR B AXR G +ACHY EY K IY +ACID AE S AX D +ACIDIC AX S IH DX IX K +ACIDIFICATION AX S IH DX AX F AX K EY SH AX N +ACIDIFIED AX S IH DX AX F AY D +ACIDIFIES AX S IH DX AX F AY Z +ACIDIFY AX S IH DX AX F AY +ACIDITY AX S IH DX AX DX IY +ACIDLY AE S AX D L IY +ACIDOSIS AE S AX D OW S AX S +ACIDS AE S AX D Z +ACIDURIA AE S AX D UH R IY AX +ACIERNO AA S IH R N OW +ACK AE K +ACKER AE K AXR +ACKER'S AE K AXR Z +ACKERLEY AE K AXR L IY +ACKERLY AE K AXR L IY +ACKERMAN AE K AXR M AX N +ACKERMANN AE K AXR M AX N +ACKERSON AE K AXR S AX N +ACKERT AE K AXR T +ACKHOUSE AE K HH AW S +ACKLAND AE K L AX N D +ACKLES AE K AX L Z +ACKLEY AE K L IY +ACKLIN AE K L IX N +ACKMAN AE K M AX N +ACKNOWLEDGE AE K N AA L IX JH +ACKNOWLEDGE(2) IX K N AA L IX JH +ACKNOWLEDGEABLE AE K N AA L IX JH AX B AX L +ACKNOWLEDGEABLE(2) IX K N AA L IX JH AX B AX L +ACKNOWLEDGED AE K N AA L IX JH D +ACKNOWLEDGED(2) IX K N AA L IX JH D +ACKNOWLEDGEMENT AE K N AA L IX JH M AX N T +ACKNOWLEDGEMENT(2) IX K N AA L IX JH M AX N T +ACKNOWLEDGES AE K N AA L IX JH IX Z +ACKNOWLEDGES(2) IX K N AA L IX JH IX Z +ACKNOWLEDGING AE K N AA L IX JH IX NG +ACKNOWLEDGING(2) IX K N AA L IX JH IX NG +ACKNOWLEDGMENT AE K N AA L IX JH M AX N T +ACKNOWLEDGMENT(2) IX K N AA L IX JH M AX N T +ACKROYD AE K R OY D +ACKROYD'S AE K R OY D Z +ACMAT AE K M AE T +ACMAT'S AE K M AE T S +ACME AE K M IY +ACME'S AE K M IY Z +ACNE AE K N IY +ACOCELLA AA K OW CH EH L AX +ACOFF AE K AO F +ACOG AX K AO G +ACOLYTE AE K AX L AY T +ACOLYTES AE K AX L AY T S +ACORD AX K AO R D +ACORN EY K AO R N +ACORNS EY K AO R N Z +ACOSTA AX K AO S T AX +ACOUSTIC AX K UW S T IX K +ACOUSTICAL AX K UW S T IX K AX L +ACOUSTICALLY AX K UW S T IX K L IY +ACOUSTICS AX K UW S T IX K S +ACQUAINT AX K W EY N T +ACQUAINTANCE AX K W EY N T AX N S +ACQUAINTANCES AX K W EY N T AX N S IX Z +ACQUAINTANCESHIP AX K W EY N T AX N S SH IX P +ACQUAINTED AX K W EY N IX D +ACQUAINTED(2) AX K W EY N T IX D +ACQUAVIVA AA K W AA V IY V AX +ACQUIESCE AE K W IY EH S +ACQUIESCED AE K W IY EH S T +ACQUIESCENCE AE K W IY EH S AX N S +ACQUIESCING AE K W IY EH S IX NG +ACQUIRE AX K W AY AXR +ACQUIRED AX K W AY AXR D +ACQUIRER AX K W AY AXR AXR +ACQUIRERS AX K W AY AXR AXR Z +ACQUIRES AX K W AY AXR Z +ACQUIRING AX K W AY AXR IX NG +ACQUIRING(2) AX K W AY R IX NG +ACQUISITION AE K W AX Z IH SH AX N +ACQUISITION'S AE K W AX Z IH SH AX N Z +ACQUISITIONS AE K W AX Z IH SH AX N Z +ACQUISITIVE AX K W IH Z AX DX IX V +ACQUIT AX K W IH T +ACQUITAINE AE K W IX T EY N +ACQUITS AX K W IH T S +ACQUITTAL AX K W IH DX AX L +ACQUITTALS AX K W IH DX AX L Z +ACQUITTED AX K W IH DX AX D +ACQUITTED(2) AX K W IH DX IX D +ACQUITTING AX K W IH DX IX NG +ACRE EY K AXR +ACREAGE EY K AXR IX JH +ACREAGE(2) EY K R AX JH +ACREE AX K R IY +ACRES EY K AXR Z +ACREY AE K R IY +ACRI AA K R IY +ACRID AE K R IX D +ACRIMONIOUS AE K R AX M OW N IY AX S +ACRIMONY AE K R IX M OW N IY +ACROBAT AE K R AX B AE T +ACROBATIC AE K R AX B AE DX IX K +ACROBATICS AE K R AX B AE DX IX K S +ACROBATS AE K R AX B AE T S +ACRONYM AE K R AX N IX M +ACRONYMS AE K R AX N IX M Z +ACROPOLIS AX K R AA P AX L AX S +ACROSS AX K R AO S +ACRYLIC AX K R IH L IX K +ACRYLICS AX K R IH L IX K S +ACT AE K T +ACT'S AE K T S +ACTAVA AE K T AA V AX +ACTED AE K T AX D +ACTED(2) AE K T IX D +ACTIGALL AE K T IX G AO L +ACTIN AE K T AX N +ACTING AE K T IX NG +ACTINIDE AE K T IX N AY D +ACTINIDIA AE K T IX N IH DX IY AX +ACTION AE K SH AX N +ACTION'S AE K SH AX N Z +ACTIONABLE AE K SH AX N AX B AX L +ACTIONS AE K SH AX N Z +ACTIVASE AE K T IX V EY Z +ACTIVATE AE K T AX V EY T +ACTIVATED AE K T AX V EY DX AX D +ACTIVATED(2) AE K T IX V EY DX IX D +ACTIVATES AE K T AX V EY T S +ACTIVATING AE K T AX V EY DX IX NG +ACTIVATION AE K T AX V EY SH AX N +ACTIVATOR AE K T AX V EY DX AXR +ACTIVE AE K T IX V +ACTIVELY AE K T IX V L IY +ACTIVES AE K T IX V Z +ACTIVISION AE K T IX V IH ZH AX N +ACTIVISM AE K T IX V IH Z AX M +ACTIVIST AE K T AX V AX S T +ACTIVIST(2) AE K T IX V IX S T +ACTIVISTS AE K T AX V AX S +ACTIVISTS' AE K T IX V IX S +ACTIVISTS'(2) AE K T IX V IX S T S +ACTIVISTS(2) AE K T AX V AX S S +ACTIVISTS(3) AE K T AX V AX S T S +ACTIVISTS(4) AE K T IX V IX S +ACTIVISTS(5) AE K T IX V IX S S +ACTIVISTS(6) AE K T IX V IX S T S +ACTIVITIES AE K T IH V AX DX IY Z +ACTIVITIES(2) AE K T IH V IX DX IY Z +ACTIVITY AE K T IH V AX DX IY +ACTIVITY(2) AE K T IH V IX DX IY +ACTMEDIA AE K T M IY DX IY AX +ACTODINE AE K T OW D AY N +ACTON AE K T AX N +ACTOR AE K T AXR +ACTOR'S AE K T AXR Z +ACTORS AE K T AXR Z +ACTORS' AE K T AXR Z +ACTRESS AE K T R AX S +ACTRESS'S AE K T R AX S IX Z +ACTRESSES AE K T R AX S IX Z +ACTS AE K S +ACTS(2) AE K T S +ACTUAL AE K CH AX W AX L +ACTUAL(2) AE K SH AX L +ACTUALITY AE K CH AX W AE L AX DX IY +ACTUALIZE AE K CH AX W AX L AY Z +ACTUALLY AE K CH AX W AX L IY +ACTUALLY(2) AE K CH L IY +ACTUALLY(3) AE K SH AX L IY +ACTUALLY(4) AE K SH L IY +ACTUARIAL AE K CH AX W EH R IY AX L +ACTUARIES AE K CH AX W EH R IY Z +ACTUARY AE K CH AX W EH R IY +ACTUATE AE K CH UW W EY T +ACTUATOR AE K CH UW EY DX AXR +ACTUATOR(2) AE K T Y UW EY DX AXR +ACTUATORS AE K CH UW EY DX AXR Z +ACTUATORS(2) AE K T Y UW EY DX AXR Z +ACTUS AE K T AX S +ACUFF AX K AH F +ACUITY AX K Y UW AX DX IY +ACUMEN AX K Y UW M AX N +ACUNA AA K UW N AX +ACUPUNCTURE AE K Y UW P AH NG K CH AXR +ACURA AE K Y AXR AX +ACURA'S AE K Y AXR AX Z +ACURAS AE K Y AXR AX Z +ACUSON AE K Y UW S AX N +ACUSTAR AE K Y UW S T AA R +ACUSYST AE K Y UW S IX S T +ACUTE AX K Y UW T +ACUTELY AX K Y UW T L IY +ACUTENESS AX K Y UW T N AX S +ACYCLOVIR AX S IH K L OW V IH R +AD AE D +AD'S AE D Z +AD-HOC AE D HH AA K +AD-LIB AE D L IH B +ADA EY DX AX +ADABEL AE DX AX B EH L +ADABELLE AE DX AX B AX L +ADACHI AA D AA K IY +ADAGE AE DX AX JH +ADAGE(2) AE DX IX JH +ADAGIO AX D AA ZH IY OW +ADAH AE DX AA +ADAIR AX D EH R +ADAIRE AA D EH R +ADAK AX D AE K +ADALAH AA D AA L AX +ADALIA AA D AA L IY AX +ADAM AE DX AX M +ADAM'S AE DX AX M Z +ADAMANT AE DX AX M AX N T +ADAMANTLY AE DX AX M AX N T L IY +ADAMCIK AA DX AX M CH IX K +ADAMCZAK AA DX AX M CH AE K +ADAMCZYK AA DX AX M CH IX K +ADAME AA D AA M IY +ADAMEC AX D AA M IX K +ADAMEK AX D AA M EH K +ADAMES AX D EY M Z +ADAMI AA D AA M IY +ADAMIK AX D AA M IX K +ADAMINA AA DX AA M IY N AX +ADAMKUS AE DX AX M K AX S +ADAMO AA D AA M OW +ADAMOWICZ AX D AA M AX V IX CH +ADAMS AE DX AX M Z +ADAMS' AE DX AX M Z +ADAMS'S AE DX AX M Z IX Z +ADAMSKI AX D AE M S K IY +ADAMSON AE DX AX M S AX N +ADAMSTOWN AE DX AX M S T AW N +ADAN EY D AX N +ADAPSO AX D AE P S OW +ADAPT AX D AE P T +ADAPTABILITY AX D AE P T AX B IH L AX DX IY +ADAPTABLE AX D AE P T AX B AX L +ADAPTAPLEX AX D AE P T AX P L EH K S +ADAPTATION AE DX AX P T EY SH AX N +ADAPTATIONS AE DX AE P T EY SH AX N Z +ADAPTATIONS(2) AE DX AX P T EY SH AX N Z +ADAPTEC AX D AE P T EH K +ADAPTED AX D AE P T AX D +ADAPTED(2) AX D AE P T IX D +ADAPTER AX D AE P T AXR +ADAPTERS AX D AE P T AXR Z +ADAPTING AX D AE P T IX NG +ADAPTIVE AX D AE P T IX V +ADAPTOR AX D AE P T AXR +ADAPTS AX D AE P T S +ADAR AX D AA R +ADARAND AE DX AX R AE N D +ADAY AX D EY +ADAZA AX D AA Z AX +ADCOCK AX D K AA K +ADCOX AX D K AA K S +ADD AE D +ADDAIR AX D EH R +ADDAMS AE DX AX M Z +ADDED AE DX AX D +ADDED(2) AE DX IX D +ADDENDUM AX D EH DX AX M +ADDENDUMS AX D EH DX AX M Z +ADDEO AA DX IY OW +ADDER AE DX AXR +ADDERLEY AX D ER L IY +ADDICKS AE DX IX K S +ADDICT AE D IH K T +ADDICT(2) AX D IH K T +ADDICTED AX D IH K T AX D +ADDICTED(2) AX D IH K T IX D +ADDICTING AX D IH K T IX NG +ADDICTION AX D IH K SH AX N +ADDICTIONS AX D IH K SH AX N Z +ADDICTIVE AX D IH K T IX V +ADDICTS AE D IH K T S +ADDICTS(2) AX D IH K T S +ADDIDAS AX D IY DX AX S +ADDIDAS' AX D IY DX AX S +ADDIDAS'S AX D IY DX AX S IX Z +ADDIDASES AX D IY DX AX S IX Z +ADDIE AE DX IY +ADDING AE DX IX NG +ADDINGTON AE DX IX NG T AX N +ADDIS AA DX IX S +ADDIS-ABABA AA DX IX S AX B AA B AX +ADDIS-ABABA(2) AA DX IY S AX B AA B AX +ADDISON AE DX AX S AX N +ADDISON'S AE DX IX S AX N Z +ADDISON(2) AE DX IX S AX N +ADDITION AX D IH SH AX N +ADDITIONAL AX D IH SH AX N AX L +ADDITIONAL(2) AX D IH SH N AX L +ADDITIONALLY AX D IH SH AX N AX L IY +ADDITIONALLY(2) AX D IH SH N AX L IY +ADDITIONS AX D IH SH AX N Z +ADDITIVE AE DX AX DX IX V +ADDITIVE(2) AE DX IX DX IX V +ADDITIVES AE DX AX DX IX V Z +ADDITIVES(2) AE DX IX DX IX V Z +ADDLE AE DX AX L +ADDLED AE DX AX L D +ADDLEMAN AE DX AX L M AX N +ADDRESS AE D R EH S +ADDRESS(2) AX D R EH S +ADDRESSABLE AX D R EH S AX B AX L +ADDRESSED AX D R EH S T +ADDRESSEE AE D R EH S IY +ADDRESSES AE D R EH S IX Z +ADDRESSES(2) AX D R EH S IX Z +ADDRESSING AX D R EH S IX NG +ADDS AE D Z +ADDUCI AA D UW CH IY +ADDWEST AE D W EH S T +ADDY AE DX IY +ADE EY D +ADEE AX D IY +ADEL AX D EH L +ADELA AX D EH L AX +ADELAAR AE DX AX L AA R +ADELAIDE AE DX AX L EY D +ADELBERT AX D EH L B AXR T +ADELE AX D EH L +ADELE'S AX D EH L Z +ADELINE AE DX AX L AY N +ADELIZZI AE DX AX L IY Z IY +ADELL AX D EH L +ADELL'S AX D EH L Z +ADELLE AX D EH L +ADELMAN AE DX AX L M AX N +ADELMAN(2) EH DX AX L M AX N +ADELMANN AE DX AX L M AX N +ADELPHA AX D EH L F AX +ADELPHIA AX D EH L F IY AX +ADELPHIA'S AX D EH L F IY AX Z +ADELSBERGER AE DX IX L Z B AXR G AXR +ADELSON AE DX AX L S AX N +ADELSTEIN AE DX AX L S T AY N +ADELSTEIN(2) AE DX AX L S T IY N +ADEN EY D AX N +ADENA AE D IX N AX +ADENAUER AE D AX N AW R +ADENAUER(2) EY D AX N AW R +ADENINE AE D AX N IY N +ADENOID AE D AX N OY D +ADENOIDS AE D AX N OY D Z +ADEPT AX D EH P T +ADEQUACY AE DX AX K W AX S IY +ADEQUATE AE DX AX K W AX T +ADEQUATE(2) AE DX AX K W EY T +ADEQUATELY AE DX AX K W AX T L IY +ADEQUATELY(2) AE DX AX K W IX T L IY +ADER EY DX AXR +ADERHOLD AE DX AXR HH OW L D +ADERHOLT AE DX AXR HH OW L T +ADERMAN AE DX AXR M AX N +ADES EY D Z +ADEY EY DX IY +ADGER AE JH AXR +ADHAM AE D HH AE M +ADHERE AX D HH IH R +ADHERED AE D HH IH R D +ADHERENCE AX D HH IH R AX N S +ADHERENT AX D HH IH R AX N T +ADHERENTS AE D HH IH R AX N T S +ADHERES AX D HH IH R Z +ADHERING AX D HH IH R IX NG +ADHESIVE AE D HH IY S IX V +ADHESIVE(2) AX D HH IY S IX V +ADHESIVES AE D HH IY S IX V Z +ADHESIVES(2) AX D HH IY S IX V Z +ADIA AA DX IY AX +ADID AX D IH D +ADIDAS AX D IY DX AX S +ADIEU AX D UW +ADIN AX D IH N +ADINA AA D IY N AX +ADINE AA D IY N IY +ADINOLFI AA D IY N OW L F IY +ADIOS AA DX IY OW S +ADIPOSE AE DX AX P OW S +ADIRONDACK AE DX AXR AA N D AE K +ADJACENT AX JH EY S AX N T +ADJANI AE D JH AA N IY +ADJECTIVE AE JH IX K T IX V +ADJECTIVES AE JH IX K T IX V Z +ADJOIN AX JH OY N +ADJOINING AX JH OY N IX NG +ADJOINS AX JH OY N Z +ADJOURN AX JH ER N +ADJOURNED AX JH ER N D +ADJOURNING AX JH ER N IX NG +ADJOURNMENT AX JH ER N M AX N T +ADJOURNS AX JH ER N Z +ADJUDGE AX JH AH JH +ADJUDGED AX JH AH JH D +ADJUDICATE AX JH UW DX IX K EY T +ADJUDICATED AX JH UW DX AX K EY DX IX D +ADJUDICATING AX JH UW DX IX K EY DX IX NG +ADJUDICATION AX JH UW DX AX K EY SH AX N +ADJUNCT AE JH AH NG K T +ADJUNCTS AE JH AH NG K T S +ADJUST AX JH AH S T +ADJUSTABLE AX JH AH S T AX B AX L +ADJUSTABLES AX JH AH S T AX B AX L Z +ADJUSTED AX JH AH S T AX D +ADJUSTED(2) AX JH AH S T IX D +ADJUSTER AX JH AH S T AXR +ADJUSTERS AX JH AH S T AXR Z +ADJUSTING AX JH AH S T IX NG +ADJUSTMENT AX JH AH S T M AX N T +ADJUSTMENTS AX JH AH S T M AX N T S +ADJUSTS AX JH AH S +ADJUSTS(2) AX JH AH S S +ADJUSTS(3) AX JH AH S T S +ADJUTANT AE JH AX T AX N T +ADKINS AE D K IX N Z +ADKINSON AE D K IX N S AX N +ADKISON AE D K IX S AX N +ADKISSON AE D K IX S AX N +ADL-TABATABA AA DX AX L T AA B AX T AA B AX +ADL-TABATABAI AA DX AX L T AA B AX T AH B AY +ADLAI AA D L AA IY +ADLER AE D L AXR +ADLEY AE D L IY +ADLON AE D L AA N +ADMAN AE D M AX N +ADMEN AE D M AX N +ADMINISTER AX D M IH N AX S T AXR +ADMINISTERED AX D M IH N AX S T AXR D +ADMINISTERING AE D M IH N IX S T AXR IX NG +ADMINISTERS AE D M IH N IX S T AXR Z +ADMINISTRATE AE D M IH N IX S T R EY T +ADMINISTRATING AX D M IH N AX S T R EY DX IX NG +ADMINISTRATION AE D M IH N IX S T R EY SH AX N +ADMINISTRATION'S AE D M IH N IX S T R EY SH AX N Z +ADMINISTRATIONS AE D M IH N IX S T R EY SH AX N Z +ADMINISTRATIVE AX D M IH N AX S T R EY DX IX V +ADMINISTRATIVELY AE D M IH N AX S T R EY DX IX V L IY +ADMINISTRATOR AX D M IH N AX S T R EY DX AXR +ADMINISTRATORS AE D M IH N IX S T R EY DX AXR Z +ADMINISTRATORS' AE D M IH N AX S T R EY DX AXR Z +ADMIRA AE D M AY R AX +ADMIRA'S AE D M AY R AX Z +ADMIRABLE AE D M AXR AX B AX L +ADMIRABLE(2) AE D M R AX B AX L +ADMIRABLY AE D M AXR AX B L IY +ADMIRAL AE D M AXR AX L +ADMIRAL'S AE D M AXR AX L Z +ADMIRALS AE D M AXR AX L Z +ADMIRALTY AE D M AXR AX L T IY +ADMIRATION AE D M AXR EY SH AX N +ADMIRATIONS AE D M AXR EY SH AX N Z +ADMIRE AE D M AY R +ADMIRED AX D M AY AXR D +ADMIRER AE D M AY R AXR +ADMIRERS AX D M AY R AXR Z +ADMIRES AE D M AY R Z +ADMIRING AE D M AY R IX NG +ADMIRINGLY AE D M AY R IX NG L IY +ADMISSIBILITY AX D M IH S AX B IH L AX DX IY +ADMISSIBLE AX D M IH S AX B AX L +ADMISSION AE D M IH SH AX N +ADMISSION(2) AX D M IH SH AX N +ADMISSIONS AE D M IH SH AX N Z +ADMISSIONS(2) AX D M IH SH AX N Z +ADMIT AX D M IH T +ADMITS AX D M IH T S +ADMITTANCE AX D M IH T AX N S +ADMITTED AX D M IH DX AX D +ADMITTEDLY AE D M IH DX IX D L IY +ADMITTING AE D M IH DX IX NG +ADMITTING(2) AX D M IH DX IX NG +ADMONISH AE D M AA N IX SH +ADMONISHED AX D M AA N IX SH T +ADMONISHES AE D M AA N IX SH IX Z +ADMONISHING AE D M AA N IX SH IX NG +ADMONISHMENT AE D M AA N IX SH M EH N T +ADMONITION AE D M AX N IH SH AX N +ADMONITIONS AE D M AX N IH SH AX N Z +ADNAN AE D N AX N +ADNEY AE D N IY +ADO AX D UW +ADOBE AX D OW B IY +ADOBE'S AX D OW B IY Z +ADOLESCENCE AE DX AX L EH S AX N S +ADOLESCENCE(2) AE DX OW L EH S AX N S +ADOLESCENT AE DX AX L EH S AX N T +ADOLESCENT(2) AE DX OW L EH S AX N T +ADOLESCENTS AE DX AX L EH S AX N T S +ADOLESCENTS(2) AE DX OW L EH S AX N T S +ADOLF EY DX AA L F +ADOLF'S EY DX AA L F S +ADOLFO AX D AA L F OW +ADOLPH EY DX AO L F +ADOLPHA AA D OW L F AX +ADOLPHSON AE DX OW L F S AX N +ADON AA D AO N +ADONIA AA D OW N IY AX +ADOPT AX D AA P T +ADOPTABLE AX D AA P T AX B AX L +ADOPTED AX D AA P T AX D +ADOPTEE AX D AA P T IY +ADOPTEES AX D AA P T IY Z +ADOPTING AX D AA P T IX NG +ADOPTION AX D AA P SH AX N +ADOPTIONS AX D AA P SH AX N Z +ADOPTIVE AX D AA P T IX V +ADOPTS AX D AA P T S +ADOR AA D AO R +ADORA AA D AO R AX +ADORABELLE AE DX AXR AX B AX L +ADORABLE AX D AO R AX B AX L +ADORATION AE DX AXR EY SH AX N +ADORE AX D AO R +ADORED AX D AO R D +ADOREE AE DX AXR IY +ADORES AX D AO R Z +ADORING AX D AO R IX NG +ADORN AX D AO R N +ADORNA AA D AO R N AX +ADORNED AX D AO R N D +ADORNMENT AX D AO R N M AX N T +ADORNO AA D AO R N OW +ADORNS AX D AO R N Z +ADRA EY D R AX +ADRAGNA AA D R AA G N AX +ADRDA EY DX AXR DX AX +ADREA AA D R IY AX +ADRENAL AX D R IY N AX L +ADRENALIN AX D R EH N AX L IX N +ADRENALINE AX D R EH N AX L AX N +ADRIA AA D R IY AX +ADRIAN EY D R IY AX N +ADRIANA EY D R IY AE N AX +ADRIANCE AA D R IY AX N S +ADRIANO AA D R IY AA N OW +ADRIATIC EY D R IY AE DX IX K +ADRIEL AX D R IY L +ADRIENNE AA D R IY EH N +ADRIFT AX D R IH F T +ADROIT AX D R OY T +ADROITLY AX D R OY T L IY +ADS AE D Z +ADS' AE D Z +ADSIT AE D S IX T +ADSS AE D S +ADSS(2) EY D IY EH S EH S +ADTEC AE D T EH K +ADULATE AE JH AX L EY T +ADULATION AE JH AX L EY SH AX N +ADULIADAE AX D UW L IY AA DX EY +ADULT AE DX AX L T +ADULT(2) AX D AH L T +ADULTERATE AX D AH L T AXR EY T +ADULTERATED AX D AH L T AXR EY DX IX D +ADULTERER AX D AH L T AXR AXR +ADULTERERS AX D AH L T AXR AXR Z +ADULTEROUS AX D AH L T AXR AX S +ADULTERY AX D AH L T AXR IY +ADULTHOOD AX D AH L T HH UH D +ADULTS AE DX AX L T S +ADULTS' AE DX AX L T S +ADULTS'(2) AX D AH L T S +ADULTS(2) AX D AH L T S +ADUSDUR AE DX AX S D AXR +ADVANCE AX D V AE N S +ADVANCED AX D V AE N S T +ADVANCEMENT AX D V AE N S M AX N T +ADVANCEMENTS AX D V AE N S M AX N T S +ADVANCER AX D V AE N S AXR +ADVANCERS AX D V AE N S AXR Z +ADVANCES AX D V AE N S AX Z +ADVANCES(2) AX D V AE N S IX Z +ADVANCING AX D V AE N S IX NG +ADVANTA AE D V AE N T AX +ADVANTA(2) AX D V AE N T AX +ADVANTAGE AE D V AE N IX JH +ADVANTAGE(2) AE D V AE N T IX JH +ADVANTAGE(3) AX D V AE N AX JH +ADVANTAGE(4) AX D V AE N T IX JH +ADVANTAGED AE D V AE N IX JH D +ADVANTAGED(2) AE D V AE N T IX JH D +ADVANTAGED(3) AX D V AE N IX JH D +ADVANTAGED(4) AX D V AE N T IX JH D +ADVANTAGEOUS AE D V AX N T EY JH AX S +ADVANTAGES AE D V AE N IX JH IX Z +ADVANTAGES(2) AE D V AE N T IX JH IX Z +ADVANTAGES(3) AX D V AE N IX JH IX Z +ADVANTAGES(4) AX D V AE N T IX JH IX Z +ADVANTEST AE D V AE N T AX S T +ADVANTEST(2) AX D V AE N T AX S T +ADVECTION AE D V EH K SH AX N +ADVENT AE D V EH N T +ADVENTIST AE D V EH N T IX S T +ADVENTISTS AE D V EH N T IX S S +ADVENTISTS(2) AE D V EH N T IX S T S +ADVENTURE AE D V EH N CH AXR +ADVENTURE(2) AX D V EH N CH AXR +ADVENTURER AE D V EH N CH AXR AXR +ADVENTURER(2) AX D V EH N CH AXR AXR +ADVENTURERS AE D V EH N CH AXR AXR Z +ADVENTURERS(2) AX D V EH N CH AXR AXR Z +ADVENTURES AE D V EH N CH AXR Z +ADVENTURES(2) AX D V EH N CH AXR Z +ADVENTURESOME AE D V EH N CH AXR S AX M +ADVENTURESOME(2) AX D V EH N CH AXR S AX M +ADVENTURISM AE D V EH N CH AXR IH Z AX M +ADVENTURISM(2) AX D V EH N CH AXR IH Z AX M +ADVENTUROUS AE D V EH N CH AXR AX S +ADVENTUROUS(2) AX D V EH N CH AXR AX S +ADVERB AE D V AXR B +ADVERBIAL AE D V ER B IY AX L +ADVERBS AE D V AXR B Z +ADVERSARIAL AE D V AXR S EH R IY AX L +ADVERSARIES AE D V AXR S EH R IY Z +ADVERSARY AE D V AXR S EH R IY +ADVERSE AE D V ER S +ADVERSE(2) AX D V ER S +ADVERSELY AE D V ER S L IY +ADVERSITY AE D V ER S IX DX IY +ADVERSITY(2) AX D V ER S IX DX IY +ADVERTISE AE D V AXR T AY Z +ADVERTISED AE D V AXR T AY Z D +ADVERTISEMENT AE D V AXR T AY Z M AX N T +ADVERTISEMENT(2) AX D V ER DX AX Z M AX N T +ADVERTISEMENTS AE D V AXR T AY Z M AX N T S +ADVERTISER AE D V AXR T AY Z AXR +ADVERTISER'S AE D V AXR T AY Z AXR Z +ADVERTISERS AE D V AXR T AY Z AXR Z +ADVERTISERS' AE D V ER T AY Z AXR Z +ADVERTISES AE D V AXR T AY Z IX Z +ADVERTISING AE D V AXR T AY Z IX NG +ADVERTISING'S AE D V AXR T AY Z IX NG Z +ADVERTORIAL AE D V AXR T AO R IY AX L +ADVERTORIALS AE D V AXR T AO R IY AX L Z +ADVEST AE D V EH S T +ADVICE AE D V AY S +ADVICE(2) AX D V AY S +ADVIL AE D V IH L +ADVIL'S AE D V IH L Z +ADVISABILITY AE D V AY Z AX B IH L IX DX IY +ADVISABLE AX D V AY Z AX B AX L +ADVISE AE D V AY Z +ADVISE(2) AX D V AY Z +ADVISED AE D V AY Z D +ADVISED(2) AX D V AY Z D +ADVISEDLY AE D V AY Z AX D L IY +ADVISEDLY(2) AX D V AY Z AX D L IY +ADVISEMENT AX D V AY Z M AX N T +ADVISER AE D V AY Z AXR +ADVISER'S AX D V AY Z AXR Z +ADVISERS AE D V AY Z AXR Z +ADVISERS' AE D V AY Z AXR Z +ADVISES AE D V AY Z IX Z +ADVISING AE D V AY Z IX NG +ADVISOR AE D V AY Z AXR +ADVISOR(2) AX D V AY Z AXR +ADVISORIES AX D V AY Z AXR IY Z +ADVISORS AE D V AY Z AXR Z +ADVISORS(2) AX D V AY Z AXR Z +ADVISORY AE D V AY Z AXR IY +ADVISORY(2) AX D V AY Z AXR IY +ADVO AE D V OW +ADVOCACY AE D V AX K AX S IY +ADVOCATE AE D V AX K AX T +ADVOCATE'S AE D V AX K AX T S +ADVOCATE(2) AE D V AX K EY T +ADVOCATED AE D V AX K EY DX AX D +ADVOCATED(2) AE D V AX K EY DX IX D +ADVOCATES AE D V AX K AX T S +ADVOCATES(2) AE D V AX K EY T S +ADVOCATING AE D V AX K EY DX IX NG +ADVOCATION AE D V AX K EY SH AX N +ADWEEK AE D W IY K +ADWELL AX D W EH L +ADY EY DX IY +ADZ AE D Z +AE EY +AEGEAN IX JH IY AX N +AEGERTER EH G AXR DX AXR +AEGIS IY JH AX S +AEGON EY G AA N +AELTUS AE L T AX S +AENEAS AE N IY AX S +AEQUITRON EY K W IX T R AA N +AER EH R +AER(2) EY IY AA R +AERIAL EH R IY AX L +AERIEN EH R IY AX N +AERIENS EH R IY AX N Z +AERITALIA EH R IX T AE L Y AX +AERO EH R OW +AEROBATIC EH R AX B AE DX IX K +AEROBATICS EH R AX B AE DX IX K S +AEROBIC EH R OW B IX K +AEROBICALLY EH R OW B IX K L IY +AEROBICS AXR OW B IX K S +AERODROME EH R AX D R OW M +AERODYNAMIC EH R OW D AY N AE M IX K +AERODYNAMICALLY EH R OW D AY N AE M IX K L IY +AERODYNAMICS EH R OW D AY N AE M IX K S +AERODYNE EH R AX D AY N +AEROFLOT EH R OW F L AA T +AEROJET EH R OW JH EH T +AEROLIFT EH R OW L IH F T +AEROLINEAS EH R OW L IH N IY AX S +AEROMEXICO EH R OW M EH K S IX K OW +AERONAUTIC EH R OW N AA DX AX K +AERONAUTICAL EH R AX N AA DX AX K AX L +AERONAUTICAL(2) EH R OW N AA DX AX K AX L +AERONAUTICAS EH R OW N AO DX IX K AX S +AERONAUTICS EH R AX N AO DX IX K S +AEROQUIP EH R AX K W IH P +AEROSMITH EH R OW S M IH TH +AEROSMITH'S EH R OW S M IH TH S +AEROSOL EH R AX S AA L +AEROSOLS EH R AX S AA L Z +AEROSPACE EH R OW S P EY S +AEROSPACE'S EH R OW S P EY S IX Z +AEROSPATIALE EH R OW S P AA S IY AA L +AEROSTAR EH R OW S T AA R +AEROSTARS EH R OW S T AA R Z +AEROSTAT EH R OW S T AE T +AEROSTATS EH R OW S T AE T S +AEROTECH EH R OW T EH K +AERTS EH R T S +AESCHLIMAN EH SH L IY M AX N +AESOP IY S AA P +AESOP'S IY S AA P S +AESTHETE EH S TH IY T +AESTHETIC EH S TH EH DX IX K +AESTHETICALLY EH S TH EH DX IX K L IY +AESTHETICS EH S TH EH DX IX K S +AETNA EH T N AX +AETNA'S EH T N AX Z +AFANASYEV AE F AX N EY S IY EH V +AFAR AX F AA R +AFFABLE AE F AX B AX L +AFFAIR AX F EH R +AFFAIRS AX F EH R Z +AFFECT AX F EH K T +AFFECTATION AE F EH K T EY SH AX N +AFFECTED AX F EH K T AX D +AFFECTED(2) AX F EH K T IX D +AFFECTING AX F EH K T IX NG +AFFECTION AX F EH K SH AX N +AFFECTIONATE AX F EH K SH AX N AX T +AFFECTIONATE(2) AX F EH K SH AX N IX T +AFFECTIONATELY AX F EH K SH AX N AX T L IY +AFFECTIONS AX F EH K SH AX N Z +AFFECTIVE AX F EH K T IX V +AFFECTIVELY AX F EH K T IX V L IY +AFFECTS AX F EH K T S +AFFELDT AE F IX L T +AFFERENT AE F AXR AX N T +AFFIANT AE F IY AX N T +AFFIDAVIT AE F AX D EY V AX T +AFFIDAVITS AE F IX D EY V IX T S +AFFILIATE AX F IH L IY AX T +AFFILIATE'S AX F IH L IY EY T S +AFFILIATE(2) AX F IH L IY EY T +AFFILIATED AX F IH L IY EY DX AX D +AFFILIATED'S AX F IH L IY EY DX IX D Z +AFFILIATED(2) AX F IH L IY EY DX IX D +AFFILIATES AX F IH L IY AX T S +AFFILIATES' AX F IH L IY IX T S +AFFILIATES(2) AX F IH L IY EY T S +AFFILIATING AX F IH L IY EY DX IX NG +AFFILIATION AX F IH L IY EY SH AX N +AFFILIATIONS AX F IH L IY EY SH AX N Z +AFFINITIES AX F IH N AX DX IY Z +AFFINITY AX F IH N AX DX IY +AFFINITY(2) AX F IH N IX DX IY +AFFIRM AX F ER M +AFFIRMATION AE F AXR M EY SH AX N +AFFIRMATIONS AE F AXR M EY SH AX N Z +AFFIRMATIVE AX F ER M AX DX IX V +AFFIRMATIVELY AX F ER M AX DX IX V L IY +AFFIRMED AX F ER M D +AFFIRMING AX F ER M IX NG +AFFIRMS AX F ER M Z +AFFIX AE F IX K S +AFFIX(2) AX F IH K S +AFFIXED AX F IH K S T +AFFIXES AE F IX K S IX Z +AFFIXES(2) AX F IH K S IX Z +AFFIXING AX F IH K S IX NG +AFFLECK AE F L IX K +AFFLERBACH AE F L AXR B AA K +AFFLICT AX F L IH K T +AFFLICTED AX F L IH K T AX D +AFFLICTED(2) AX F L IH K T IX D +AFFLICTING AX F L IH K T IX NG +AFFLICTION AX F L IH K SH AX N +AFFLICTIONS AX F L IH K SH AX N Z +AFFLICTS AX F L IH K T S +AFFLIK AE F L IH K +AFFLUENCE AE F L UW AX N S +AFFLUENT AE F L UW AX N T +AFFOLTER AE F OW L T AXR +AFFORD AX F AO R D +AFFORDABILITY AX F AO R DX AX B IH L AX DX IY +AFFORDABLE AX F AO R DX AX B AX L +AFFORDED AX F AO R DX AX D +AFFORDING AX F AO R DX IX NG +AFFORDS AX F AO R D Z +AFFRICATE AE F R AX K AX T +AFFRICATES AE F R AX K AX T S +AFFRICATION AE F R AX K EY SH AX N +AFFRONT AX F R AH N T +AFFRONTED AX F R AH N T IX D +AFFRONTS AX F R AH N T S +AFFYMAX AE F IY M AE K S +AFGHAN AE F G AE N +AFGHANI AE F G AA N IY +AFGHANI'S AE F G AE N IY Z +AFGHANIS AE F G AE N IY Z +AFGHANISTAN AE F G AE N AX S T AE N +AFGHANISTAN'S AE F G AE N AX S T AE N Z +AFGHANS AE F G AE N Z +AFHELDT AE F EH L T +AFICIONADO AX F IY SH Y AX N AA D OW +AFICIONADOS AX F IH SH AX N AA DX OW Z +AFIELD AX F IY L D +AFIRE AX F AY R +AFLAME AX F L EY M +AFLATOXIN AE F L AX T AA K S IX N +AFLOAT AX F L OW T +AFLUTTER AX F L AH DX AXR +AFMED AE F M EH D +AFONSO AX F AA N S OW +AFOOT AX F UH T +AFOREMENTIONED AX F AO R M EH N SH AX N D +AFORESAID AX F AO R S EH D +AFORETHOUGHT AX F AO R TH AA T +AFOUL AX F AW L +AFRAID AX F R EY D +AFRESH AX F R EH SH +AFRICA AE F AXR K AX +AFRICA'S AE F R AX K AX Z +AFRICA'S(2) AE F R IX K AX Z +AFRICA(2) AE F R AX K AX +AFRICA(3) AE F R IX K AX +AFRICAN AE F R AX K AX N +AFRICAN(2) AE F R IX K AX N +AFRICANIST AE F R IX K AX N IX S T +AFRICANIZE AE F R AX K AX N AY Z +AFRICANIZED AE F R AX K AX N AY Z D +AFRICANS AE F R AX K AX N Z +AFRICANS(2) AE F R IX K AX N Z +AFRIKAANS AE F R AX K AA N Z +AFRIKANER AE F R AX K AA N AXR +AFRIKANERDOM AE F R AX K AA N AXR DX AX M +AFRIKANERS AE F R IX K AA N AXR Z +AFRO AE F R OW +AFSANE AA F S AA N EY +AFSANE'S AA F S AA N EY Z +AFSHAR AE F SH AXR +AFT AE F T +AFTER AE F T AXR +AFTERALL AE F T AXR AA L +AFTERBURNER AE F T AXR B ER N AXR +AFTERBURNERS AE F T AXR B ER N AXR Z +AFTEREFFECT AE F T AXR AX F EH K T +AFTEREFFECTS AE F T AXR AX F EH K T S +AFTERGLOW AE F T AXR G L OW +AFTERIMAGE AE F T AXR IH M IX JH +AFTERLIFE AE F T AXR L AY F +AFTERMARKET AE F T AXR M AA R K IX T +AFTERMATH AE F T AXR M AE TH +AFTERNOON AE F T AXR N UW N +AFTERNOON'S AE F T AXR N UW N Z +AFTERNOONS AE F T AXR N UW N Z +AFTERSHOCK AE F T AXR SH AA K +AFTERSHOCKS AE F T AXR SH AA K S +AFTERTASTE AE F T AXR T EY S T +AFTERTAX AE F T AXR T AE K S +AFTERTHOUGHT AE F T AXR TH AA T +AFTERTHOUGHT(2) AE F T AXR TH AO T +AFTERWARD AE F T AXR W AXR D +AFTERWARDS AE F T AXR W AXR D Z +AFULA AX F UW L AX +AFULA'S AX F UW L AX Z +AG AE G +AGA AA G AX +AGACHE AE G AE CH +AGAIN AX G EH N +AGAIN(2) AX G EY N +AGAINST AX G EH N S T +AGAMEMNON AE G AX M EH M N AA N +AGAMEMNON'S AE G AX M EH M N AA N Z +AGAN EY G AX N +AGANBEGYAN AE G AX N B EH G Y AX N +AGANS AA G AA N Z +AGAPE AX G EY P +AGAR EY G AXR +AGARD AE G AXR D +AGARWAL AA G AA R W AA L +AGASSI AE G AX S IY +AGASSIZ AX G AE S IX Z +AGATE AE G AX T +AGATES AE G AX T S +AGATHA AE G AX TH AX +AGCO AE G K OW +AGE EY JH +AGE'S EY JH IX Z +AGED EY JH D +AGED(2) EY JH IX D +AGEE EY JH IY +AGEE'S EY JH IY Z +AGELESS EY JH L AX S +AGENCE AE JH AX N S +AGENCIES EY JH AX N S IY Z +AGENCIES' EY JH AX N S IY Z +AGENCY EY JH AX N S IY +AGENCY'S EY JH AX N S IY Z +AGENDA AX JH EH N D AX +AGENDAS AX JH EH N D AX Z +AGENT EY JH AX N T +AGENT'S EY JH AX N T S +AGENTS EY JH AX N T S +AGENTS' EY JH AX N T S +AGER EY JH AXR +AGERATUM AX JH EH R AX DX AX M +AGERATUMS AX JH EH R AX DX AX M Z +AGERS EY JH AXR Z +AGERS' EY JH AXR Z +AGERTON EY G AXR T AX N +AGES EY JH AX Z +AGES(2) EY JH IX Z +AGFA AE G F AX +AGGARWAL AX G AA R W AX L +AGGIE AE G IY +AGGIES AE G IY Z +AGGLOMERATE AX G L AA M AXR EY T +AGGLOMERATION AX G L AA M AXR EY SH AX N +AGGLUTINATE AX G L UW T IX N EY T +AGGRANDIZE AX G R AE N D AY Z +AGGRANDIZEMENT AE G R AX N D AY Z M AX N T +AGGRANDIZEMENT(2) AX G R AE N D AY Z M AX N T +AGGRANDIZING AE G R AX N D AY Z IX NG +AGGRANDIZING(2) AX G R AE N D AY Z IX NG +AGGRAVATE AE G R AX V EY T +AGGRAVATED AE G R AX V EY DX AX D +AGGRAVATED(2) AE G R AX V EY DX IX D +AGGRAVATES AE G R AX V EY T S +AGGRAVATING AE G R AX V EY DX IX NG +AGGRAVATION AE G R AX V EY SH AX N +AGGREGATE AE G R AX G AX T +AGGREGATE(2) AE G R AX G EY T +AGGREGATE(3) AE G R AX G IX T +AGGREGATED AE G R AX G EY DX AX D +AGGREGATES AE G R AX G EY T S +AGGREGATES(2) AE G R AX G IX T S +AGGRESS AX G R EH S +AGGRESSION AX G R EH SH AX N +AGGRESSIONS AX G R EH SH AX N Z +AGGRESSIVE AX G R EH S IX V +AGGRESSIVELY AX G R EH S IX V L IY +AGGRESSIVENESS AX G R EH S IX V N AX S +AGGRESSIVITY AX G R EH S IH V IX DX IY +AGGRESSOR AX G R EH S AXR +AGGRESSORS AX G R EH S AXR Z +AGGREY AE G R EY +AGGRIEVE AX G R IY V +AGGRIEVED AX G R IY V D +AGGY AE G IY +AGHAST AX G AE S T +AGHAZADEH AE G AX Z AA D EH +AGIE AE G IY +AGILDO AX G IH L D OW +AGILE AE JH AX L +AGILIS AX JH IH L AX S +AGILITY AX JH IH L AX DX IY +AGIN AA JH IY N +AGINCOURT AE JH AX N K AO R T +AGING EY JH IX NG +AGINS EY G IX N Z +AGIP EY G IX P +AGITATE AE JH AX T EY T +AGITATED AE JH AX T EY DX AX D +AGITATING AE JH AX T EY DX IX NG +AGITATION AE JH AX T EY SH AX N +AGITATOR AE JH AX T EY DX AXR +AGITATORS AE JH IX T EY DX AXR Z +AGIUS EY JH IY IX S +AGLEAM AX G L IY M +AGLER AE G L AXR +AGLITTER AX G L IH DX AXR +AGLO AX G L OW +AGLOW AX G L OW +AGNA AE G N AX +AGNE EY N Y +AGNELLA AE G N EH L AX +AGNELLI AE G N EH L IY +AGNELLO AE G N EH L OW +AGNER AE G N AXR +AGNES AE G N IX S +AGNETA AA G N EH DX AX +AGNEW AE G N UW +AGNEW(2) AE G N Y UW +AGNICO AE G N IX K OW +AGNOR AE G N AXR +AGNOS AE G N OW S +AGNOSIO AE G N OW S IY OW +AGNOSTIC AE G N AA S T IX K +AGO AX G OW +AGOG AX G AA G +AGOGLIA AX G AA G L IY AX +AGONIES AE G AX N IY Z +AGONIST AE G AX N IX S T +AGONISTS AE G AX N IX S +AGONISTS(2) AE G AX N IX S S +AGONISTS(3) AE G AX N IX S T S +AGONIZE AE G AX N AY Z +AGONIZED AE G AX N AY Z D +AGONIZES AE G AX N AY Z IX Z +AGONIZING AE G AX N AY Z IX NG +AGONIZINGLY AE G AX N AY Z IX NG L IY +AGONY AE G AX N IY +AGORA AE G AXR AX +AGOSTA AA G OW S T AX +AGOSTINELLI AA G OW S T IY N EH L IY +AGOSTINI AA G OW S T IY N IY +AGOSTINO AA G AO S T IY N OW +AGOSTO AA G OW S T OW +AGOURA AX G UW R AX +AGOURON AX G UW R AA N +AGRA AE G R AX +AGRARIAN AX G R EH R IY AX N +AGRARIANISM AX G R EH R IY AX N IH Z AX M +AGRAWAL AX G R AE W AX L +AGREE AX G R IY +AGREEABLE AX G R IY AX B AX L +AGREED AX G R IY D +AGREEING AX G R IY IX NG +AGREEMENT AX G R IY M AX N T +AGREEMENT'S AX G R IY M AX N T S +AGREEMENTS AX G R IY M AX N T S +AGREES AX G R IY Z +AGRESOURCE AA G R EH S AO R S +AGRESOURCE(2) AE G R AX S AO R S +AGRESTA AA G R EH S T AX +AGRESTI AA G R EH S T IY +AGREXCO AA G R EH K S K OW +AGRI AE G R IY +AGRIBUSINESS AE G R AX B IH Z N AX S +AGRICO AX G R IY K OW +AGRICOLA AE G R IX K OW L AX +AGRICOLE AE G R IX K OW L +AGRICULTURAL AE G R AX K AH L CH AXR AX L +AGRICULTURAL(2) AE G R IX K AH L CH AXR AX L +AGRICULTURALIST AE G R AX K AH L CH AXR AX L AX S T +AGRICULTURALLY AE G R IX K AH L CH AXR AX L IY +AGRICULTURALLY(2) AE G R IX K AH L CH R AX L IY +AGRICULTURE AE G R IX K AH L CH AXR +AGRICULTURE'S AE G R IX K AH L CH AXR Z +AGRIFUEL AE G R AX F Y UW L +AGRIFUELS AE G R AX F Y UW L Z +AGRIPPA AX G R IH P AX +AGRIVISOR AE G R AX V AY Z AXR +AGRO AE G R OW +AGROCHEMICAL AE G R OW K EH M AX K AX L +AGROCHEMICALS AE G R OW K EH M IX K AX L Z +AGROKOMERC AE G R AX K OW M ER K +AGRONOMIST AX G R AA N AX M IX S T +AGRONOMISTS AX G R AA N AX M IX S +AGRONOMISTS(2) AX G R AA N AX M IX S S +AGRONOMISTS(3) AX G R AA N AX M IX S T S +AGROSIAND AX G R OW S IY AX N D +AGROUND AX G R AW N D +AGRUSA AA G R UW S AX +AGUA AA G W AX +AGUACATE AE G W AX K EY T +AGUADO AA G W AA DX OW +AGUAYO AA G W EY OW +AGUDELO AA G UW D EY L OW +AGUERO AA G EH R OW +AGUIAR AA G W IY AXR +AGUILA AA G W IY L AX +AGUILAR AE G AX L AA R +AGUILERA AA G W IY L EH R AX +AGUILLAR AE G AX L AA R +AGUILLARD AE G IX L AXR D +AGUILLON AA G W IY L AO N +AGUINAGA AA G UW IY N AA G AX +AGUIRRA AX G W IH R AX +AGUIRRA'S AX G W IH R AX Z +AGUIRRE AA G W IH R EY +AGUIRRE'S AA G W IH R EY Z +AGUIRRE'S(2) AX G W IH R EY Z +AGUIRRE(2) AX G W IH R EY +AGUSTIN AX G AO S T IX N +AH AA +AHA AA HH AA +AHAB EY HH AE B +AHAH AA HH AA +AHARON AE HH AXR AA N +AHART AX HH AA R T +AHAULSIE AX HH AA L S IY +AHEAD AX HH EH D +AHEARN AX HH ER N +AHERIN AA AXR IX N +AHERN AX HH ER N +AHERNE AX HH ER N +AHH AA +AHL AA L +AHLBERG AA L B AXR G +AHLBORN AA L B AXR N +AHLEN AA L AX N +AHLEN(2) AX L EY N +AHLERS AA L AXR Z +AHLES EY AX L Z +AHLF AA L F +AHLGREN AA L G R EH N +AHLGRIM AA L G R IX M +AHLIN AA L IX N +AHLMAN AA L M AX N +AHLQUIST AA L K W IH S T +AHLSTRAND AA L S T R AX N D +AHLSTROM AA L S T R AX M +AHMAD AA M AA D +AHMADI AA M AA DX IY +AHMANN AA M AX N +AHMANSON AA M AX N S AX N +AHMED AA M AX D +AHMED(2) AA M EH D +AHMOUDI AA M UW DX IY +AHN AE N +AHNER AA N AXR +AHO AA HH OW +AHOLA AE HH AX L AX +AHOLD AX HH OW L D +AHONEN AX HH OW N AX N +AHR AA R +AHRANAT AX R AA N AX T +AHREN AA R AX N +AHRENDT AA R IX N T +AHRENS AA R IX N Z +AHS AA Z +AHUJA AA HH UW Y AX +AHUMADA AA Y UW M AA DX AX +AI AY +AI(2) EY AY +AICHELE AY K AX L +AICHER AY K AXR +AICHI AA IY CH IY +AICKIN EY K IX N +AID EY D +AID'S EY D Z +AIDA AY IY DX AX +AIDAN AA IY D AA N +AIDE EY D +AIDE'S EY D Z +AIDED EY DX AX D +AIDED(2) EY DX IX D +AIDES EY D Z +AIDES' EY D Z +AIDID AY D IY D +AIDID'S AY D IY D Z +AIDING EY DX IX NG +AIDS EY D Z +AIELLO AY EH L OW +AIGNER EH N Y EY +AIGNER(2) EY K N AXR +AIGNER(3) EY N AXR +AIGUEBELLE AY G AX B EH L +AIKEN EY K IX N +AIKENS EY K IX N Z +AIKEY EY K IY +AIKIN EY K IX N +AIKINS AY K IX N Z +AIKMAN EY K M AX N +AIL EY L +AILEE EY L IY +AILEEN AY L IY N +AILERON EY L AXR AA N +AILERONS EY L AXR AA N Z +AILES AY L Z +AILES(2) EY L Z +AILEY EY L IY +AILING EY L IX NG +AILMENT EY L M AX N T +AILMENTS EY L M AX N T S +AILOR EY L AXR +AILS EY L Z +AILSA EY L S AX +AIM EY M +AIME EY M +AIMED EY M D +AIMEE EY M IY +AIMING EY M IX NG +AIMLESS EY M L AX S +AIMLESSLY EY M L AX S L IY +AIMONE EY M OW N +AIMS EY M Z +AIN'T EY N T +AINE EY N +AINGE EY N JH +AINGE(2) EY NG +AINLEY EY N L IY +AINSBERG EY N Z B AXR G +AINSLEY EY N S L IY +AINSLIE EY N Z L IY +AINSWORTH EY N S W AXR TH +AINSWORTH'S EY N Z W AXR TH S +AIPAC AY P AE K +AIPAC'S AY P AE K S +AIR EH R +AIR'S EH R Z +AIRBAG EH R B AE G +AIRBAGS EH R B AE G Z +AIRBASE EH R B EY S +AIRBASES EH R B EY S IX S +AIRBOAT EH R B OW T +AIRBOATS EH R B OW T S +AIRBORNE EH R B AO R N +AIRBORNE'S EH R B AO R N Z +AIRBUS EH R B AX S +AIRBUS'S EH R B AX S IX Z +AIRCAL EH R K AA L +AIRCAL'S EH R K AE L Z +AIRCO EH R K OW +AIRCOA EH R K OW AX +AIRCRAFT EH R K R AE F T +AIRCRAFT'S EH R K R AE F S +AIRCRAFT'S(2) EH R K R AE F T S +AIRCRAFTS EH R K R AE F S +AIRCRAFTS(2) EH R K R AE F T S +AIRCREW EH R K R UW +AIRD EH R D +AIRDROP EH R D R AA P +AIRDROPS EH R D R AA P S +AIRED EH R D +AIREDALE EH R D EY L +AIRES EH R IY Z +AIREY EH R IY +AIRFARE EH R F EH R +AIRFARES EH R F EH R Z +AIRFIELD EH R F IY L D +AIRFIELDS EH R F IY L D Z +AIRFLOW EH R F L OW +AIRFOIL EH R F OY L +AIRFOILS EH R F OY L Z +AIRFONE EH R F OW N +AIRFORCE EH R F AO R S +AIRFRAME EH R F R EY M +AIRFREIGHT EH R F R EY T +AIRGAS EH R G AE S +AIRGLOW EH R G L OW +AIRHART EH R HH AA R T +AIRHEAD EH R HH EH D +AIRING EH R IX NG +AIRINGTON EH R IX NG T AX N +AIRLESS EH R L AX S +AIRLIA EH R L IY AX +AIRLIE EH R L IY +AIRLIFT EH R L IH F T +AIRLIFTED EH R L IH F T IX D +AIRLIFTING EH R L IH F T IX NG +AIRLIFTS EH R L IH F T S +AIRLINE EH R L AY N +AIRLINE'S EH R L AY N Z +AIRLINER EH R L AY N AXR +AIRLINER'S EH R L AY N AXR Z +AIRLINERS EH R L AY N AXR Z +AIRLINES EH R L AY N Z +AIRLINES' EH R L AY N Z +AIRLINK EH R L IH NG K +AIRLOCK EH R L AO K +AIRMAIL EH R M EY L +AIRMAN EH R M AX N +AIRMAN'S EH R M AX N Z +AIRMEN EH R M EH N +AIRMOTIVE EH R M OW DX IX V +AIRPLANE EH R P L EY N +AIRPLANE'S EH R P L EY N Z +AIRPLANES EH R P L EY N Z +AIRPORT EH R P AO R T +AIRPORT'S EH R P AO R T S +AIRPORTS EH R P AO R T S +AIRPOWER EH R P AW AXR +AIRS EH R Z +AIRSHIP EH R SH IH P +AIRSHIPS EH R SH IH P S +AIRSPACE EH R S P EY S +AIRSPEED EH R S P IY D +AIRSTRIKE EH R S T R AY K +AIRSTRIKES EH R S T R AY K S +AIRSTRIP EH R S T R IH P +AIRSTRIPS EH R S T R IH P S +AIRTIGHT EH R T AY T +AIRTIME EH R T AY M +AIRTOUCH EH R T AH CH +AIRTRAN EH R T R AE N +AIRWAVE EH R W EY V +AIRWAVES EH R W EY V Z +AIRWAY EH R W EY +AIRWAY'S EH R W EY Z +AIRWAYS EH R W EY Z +AIRWAYS' EH R W EY Z +AIRWING EH R W IX NG @@ Diff output truncated at 60000 characters. @@ From svetastenchikova at gmail.com Fri Apr 13 09:34:48 2007 From: svetastenchikova at gmail.com (Svetlana Stenchikova) Date: Fri, 13 Apr 2007 09:34:48 -0400 Subject: [RavenclawDev 244] galaxy - are messages queued? Message-ID: <31cecd6b0704130634j6c0fce8ep768a7d3b01c02449@mail.gmail.com> Hi, I have a question about the Galaxy communicator. When a hub passes messages to agents, do these messages get queued? If an agent is busy at the moment a message arrives, would it get this message later when it is ready to receive or will the message get lost? I think I am experiencing a problem of losing messages. Could anyone please confirm the functionality? Maybe there is a setting somewhere to enable or disable queuing? thank you Svetlana From tkharris at cs.cmu.edu Fri Apr 13 11:25:58 2007 From: tkharris at cs.cmu.edu (Thomas K Harris) Date: Fri, 13 Apr 2007 11:25:58 -0400 Subject: [RavenclawDev 245] Re: galaxy - are messages queued? In-Reply-To: <31cecd6b0704130634j6c0fce8ep768a7d3b01c02449@mail.gmail.com> References: <31cecd6b0704130634j6c0fce8ep768a7d3b01c02449@mail.gmail.com> Message-ID: <461FA106.1070404@cs.cmu.edu> I was pretty sure that the hub should always queue. You can log incoming and outgoing messages from the hub to see what's going on. There's also a hub visualization server written in Java http://communicator.sourceforge.net/sites/MITRE/distributions/OSTK-20021004/utilities/hub_gui/doc/hub_gui.html which I believe will show you what or at least how many messages are currently queued up. -Thomas Svetlana Stenchikova wrote: > Hi, > > I have a question about the Galaxy communicator. > > When a hub passes messages to agents, do these messages get queued? > If an agent is busy at the moment a message arrives, would it get this > message later when it is ready to receive or will the message get > lost? > > I think I am experiencing a problem of losing messages. > > Could anyone please confirm the functionality? > Maybe there is a setting somewhere to enable or disable queuing? > > thank you > > Svetlana > From svetastenchikova at gmail.com Fri Apr 13 12:18:27 2007 From: svetastenchikova at gmail.com (Svetlana Stenchikova) Date: Fri, 13 Apr 2007 12:18:27 -0400 Subject: [RavenclawDev 246] Re: galaxy - are messages queued? In-Reply-To: <461FA106.1070404@cs.cmu.edu> References: <31cecd6b0704130634j6c0fce8ep768a7d3b01c02449@mail.gmail.com> <461FA106.1070404@cs.cmu.edu> Message-ID: <31cecd6b0704130918p6a011459h7ff84043983059f9@mail.gmail.com> Antoine and Thomas, thank you for your confirmations, Antoine, let me double-check it again and if I am still seeing the problem, I will email you the pgm and hub logs. thanks! Svetlana On 4/13/07, Thomas K Harris wrote: > I was pretty sure that the hub should always queue. You can log incoming > and outgoing messages from the hub to see what's going on. There's also > a hub visualization server written in Java > > http://communicator.sourceforge.net/sites/MITRE/distributions/OSTK-20021004/utilities/hub_gui/doc/hub_gui.html > > which I believe will show you what or at least how many messages are > currently queued up. > > -Thomas > > Svetlana Stenchikova wrote: > > Hi, > > > > I have a question about the Galaxy communicator. > > > > When a hub passes messages to agents, do these messages get queued? > > If an agent is busy at the moment a message arrives, would it get this > > message later when it is ready to receive or will the message get > > lost? > > > > I think I am experiencing a problem of losing messages. > > > > Could anyone please confirm the functionality? > > Maybe there is a setting somewhere to enable or disable queuing? > > > > thank you > > > > Svetlana > > > > From tk at edam.speech.cs.cmu.edu Fri Apr 13 17:22:37 2007 From: tk at edam.speech.cs.cmu.edu (tk@edam.speech.cs.cmu.edu) Date: Fri, 13 Apr 2007 17:22:37 -0400 Subject: [RavenclawDev 247] [21] Tools/MakeLM/makelm.pl: Message-ID: <200704132122.l3DLMbIi010735@edam.speech.cs.cmu.edu> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/ravenclaw-developers/attachments/20070413/e3ac106e/attachment.html -------------- next part -------------- Modified: Tools/MakeLM/makelm.pl =================================================================== --- Tools/MakeLM/makelm.pl 2007-04-06 20:08:03 UTC (rev 20) +++ Tools/MakeLM/makelm.pl 2007-04-13 21:22:37 UTC (rev 21) @@ -75,6 +75,8 @@ &say('compile', 'compiling dictionary...'); &getdict($DICT, $REDUCED_DICT, $VOCAB); &say('compile', "done\n"); +close(LOG) if $LOGFILE; +exit; sub usage { return "usage: $0 [-resourcesdir {resources directory}] [-samplesize {sample size}] [-source {source}] {project name}$/"; @@ -101,6 +103,7 @@ print CORPUS " $_ \n"; } close CORPUS; + close RANDOM; } sub getvocab { @@ -111,6 +114,7 @@ binmode VOCAB; open(BASE, "<$basefile") || &fail("Can't open $basefile"); my @base = map { /(.*) .*/? uc("$1\n"): () } ; + close BASE; print VOCAB grep !/<\/?S>/, sort(@base); print VOCAB "\n"; print VOCAB "\n"; @@ -135,6 +139,7 @@ s/=/_/g; push @long, $_; } + close VOCAB; foreach (&shorten(@long)) { s/_/=/g; print DICT "$_\n"; @@ -259,6 +264,7 @@ push @retval, $_; last if $last_token eq (split(' ',$_))[0]; } + $pout->close; map s/[\r\n]//g, @retval; #waitpid $ppid, 0; return @retval; From svetastenchikova at gmail.com Sun Apr 15 17:27:26 2007 From: svetastenchikova at gmail.com (Svetlana Stenchikova) Date: Sun, 15 Apr 2007 17:27:26 -0400 Subject: [RavenclawDev 248] Re: galaxy - are messages queued? In-Reply-To: <31cecd6b0704130918p6a011459h7ff84043983059f9@mail.gmail.com> References: <31cecd6b0704130634j6c0fce8ep768a7d3b01c02449@mail.gmail.com> <461FA106.1070404@cs.cmu.edu> <31cecd6b0704130918p6a011459h7ff84043983059f9@mail.gmail.com> Message-ID: <31cecd6b0704151427r596c4186qafd83c22dea2889d@mail.gmail.com> I am not seeing this problem any more. I think I had some problem with managing threads, once I fixed it, I seem to be getting all messages. thanks Svetlana On 4/13/07, Svetlana Stenchikova wrote: > Antoine and Thomas, thank you for your confirmations, > > Antoine, let me double-check it again and if I am still seeing the > problem, I will email you the pgm and hub logs. > > thanks! > Svetlana > > On 4/13/07, Thomas K Harris wrote: > > I was pretty sure that the hub should always queue. You can log incoming > > and outgoing messages from the hub to see what's going on. There's also > > a hub visualization server written in Java > > > > http://communicator.sourceforge.net/sites/MITRE/distributions/OSTK-20021004/utilities/hub_gui/doc/hub_gui.html > > > > which I believe will show you what or at least how many messages are > > currently queued up. > > > > -Thomas > > > > Svetlana Stenchikova wrote: > > > Hi, > > > > > > I have a question about the Galaxy communicator. > > > > > > When a hub passes messages to agents, do these messages get queued? > > > If an agent is busy at the moment a message arrives, would it get this > > > message later when it is ready to receive or will the message get > > > lost? > > > > > > I think I am experiencing a problem of losing messages. > > > > > > Could anyone please confirm the functionality? > > > Maybe there is a setting somewhere to enable or disable queuing? > > > > > > thank you > > > > > > Svetlana > > > > > > > > From svetastenchikova at gmail.com Sun Apr 15 17:44:37 2007 From: svetastenchikova at gmail.com (Svetlana Stenchikova) Date: Sun, 15 Apr 2007 17:44:37 -0400 Subject: [RavenclawDev 249] receiving messages from INPUT_LINE_CONFIGURATION Message-ID: <31cecd6b0704151444x7b48b44brfaa7affd0a481fa6@mail.gmail.com> My Dialog manager has statements: INPUT_LINE_CONFIGURATION("set_grammar=bla") These messages should be broadcast to all servers, right? I am intercepting this message in the ASR server with serverOpSetDialogState function. I also get a call in serverOpSetGrammar() in my ASR seerver I am now trying to get the same message in the TTY server. I added the messages in the pgm file, so when the TTY server starts up, it prints: {c JavaTTY :signatures (("setgrammar" () 2 6 () 2) ( "processparse" () 2 6 () 2) ( "speak" () 2 6 () 2) ( "reinitialize" () 2 6 () 2) ( "setdialogstate" () 2 6 () 2)) however the tty server does not seem to get neither SetDialogState nor SetGrammar messages. What could be a reason for the tty server not getting these messages? thank you Svetlana From svetastenchikova at gmail.com Sun Apr 15 22:30:18 2007 From: svetastenchikova at gmail.com (Svetlana Stenchikova) Date: Sun, 15 Apr 2007 22:30:18 -0400 Subject: [RavenclawDev 250] checking if an agent has been restarted Message-ID: <31cecd6b0704151930q3a0ba4b6oba110cd341dadebd@mail.gmail.com> Hi, does RavenClaw have any facility to check if the dialog has been "restarted"? I would like to play a different message when the dialog is 'restarted' than when it is 'started' for the first time, but I do not see how I can check for that. When a user says 'restart' all agents are recreated, so that all reset, reopen counters start from 0 again. I can add to DialogAgent a static variable 'countCreated', which counts every time any agent is created, but this is not a nice solution. Can someone suggest a better way? thank you Svetlana From antoine at cs.cmu.edu Mon Apr 16 00:29:51 2007 From: antoine at cs.cmu.edu (Antoine Raux) Date: Mon, 16 Apr 2007 00:29:51 -0400 Subject: [RavenclawDev 251] Re: checking if an agent has been restarted In-Reply-To: <31cecd6b0704151930q3a0ba4b6oba110cd341dadebd@mail.gmail.com> References: <31cecd6b0704151930q3a0ba4b6oba110cd341dadebd@mail.gmail.com> Message-ID: <006501c77fdf$e07929e0$03bd0280@sp.cs.cmu.edu> Hi Svetlana, We had a similar issue in Let's Go so let me describe it and how we addressed it. Hopefully that'll help you. At the very beginning of the dialog, the system gives an introduction message ("Welcome to Let's Go (...) To get help say HELP (...)"), which we do not want to repeat on a start over (in that case we just want "Okay let's start from the beginning. What can I do for you?"). The solution was to 1) define an inform prompt for starting_over as "Okay let's start from the beginning." (this prompt is automatically spoken by the standard StartOver agency) 2) define a Let's Go specific StartOver function. The latter is done by adding: CUSTOM_START_OVER(LetsGoPublicStartOver) to the CORE_CONFIGURATION section, and define a function called LetsGoPublicStartOver() as follows (sorry for the potential spurious line breaks...): // D: define the start-over routine for lets go public void LetsGoPublicStartOver() { // Resets only the subttree in charge of the actual task // (so as not to repeat the introduction) CDialogAgent& rda = pDTTManager->GetDialogTaskTreeRoot()->A("/LetsGoPublic/PerformTask"); rda.Reset(); pDMCore->PopTopicFromExecutionStack(pDTTManager->GetDialogTaskTreeRoot()); pDMCore->ContinueWith(pDMCore, pDTTManager->GetDialogTaskTreeRoot()); } In our case, this function restarts the PerformTask subtree instead of the whole tree (the introduction prompt is not in PerformTask). Of course, you could do other stuff in this function... So here is how we solved our problem. I hope that'll help you solve yours. Let me know if you have questions... antoine -----Original Message----- From: ravenclaw-developers-bounces at LOGANBERRY.srv.cs.cmu.edu [mailto:ravenclaw-developers-bounces at LOGANBERRY.srv.cs.cmu.edu] On Behalf Of Svetlana Stenchikova Sent: Sunday, April 15, 2007 10:30 PM To: ravenclaw-developers at cs.cmu.edu Subject: [RavenclawDev 250] checking if an agent has been restarted Hi, does RavenClaw have any facility to check if the dialog has been "restarted"? I would like to play a different message when the dialog is 'restarted' than when it is 'started' for the first time, but I do not see how I can check for that. When a user says 'restart' all agents are recreated, so that all reset, reopen counters start from 0 again. I can add to DialogAgent a static variable 'countCreated', which counts every time any agent is created, but this is not a nice solution. Can someone suggest a better way? thank you Svetlana From udhay at cmu.edu Mon Apr 16 00:41:10 2007 From: udhay at cmu.edu (Udhyakumar N) Date: Mon, 16 Apr 2007 00:41:10 -0400 Subject: [RavenclawDev 252] Re: checking if an agent has been restarted In-Reply-To: <006501c77fdf$e07929e0$03bd0280@sp.cs.cmu.edu> References: <31cecd6b0704151930q3a0ba4b6oba110cd341dadebd@mail.gmail.com> <006501c77fdf$e07929e0$03bd0280@sp.cs.cmu.edu> Message-ID: <9e876f3b0704152141i273c6393l14c51508778f7927@mail.gmail.com> A small clarification. What is the difference between reopening all the agents except Welcome prompt at the end and the method you just described? -Udhay On 4/16/07, Antoine Raux wrote: > Hi Svetlana, > > We had a similar issue in Let's Go so let me describe it and how we > addressed it. Hopefully that'll help you. > > At the very beginning of the dialog, the system gives an introduction > message ("Welcome to Let's Go (...) To get help say HELP (...)"), which we > do not want to repeat on a start over (in that case we just want "Okay let's > start from the beginning. What can I do for you?"). The solution was to > > 1) define an inform prompt for starting_over as "Okay let's start from the > beginning." (this prompt is automatically spoken by the standard StartOver > agency) > > 2) define a Let's Go specific StartOver function. > The latter is done by adding: > > CUSTOM_START_OVER(LetsGoPublicStartOver) > > to the CORE_CONFIGURATION section, and define a function called > LetsGoPublicStartOver() as follows (sorry for the potential spurious line > breaks...): > > // D: define the start-over routine for lets go public > void LetsGoPublicStartOver() { > // Resets only the subttree in charge of the actual task > // (so as not to repeat the introduction) > CDialogAgent& rda = > > pDTTManager->GetDialogTaskTreeRoot()->A("/LetsGoPublic/PerformTask"); > rda.Reset(); > > pDMCore->PopTopicFromExecutionStack(pDTTManager->GetDialogTaskTreeRoot()); > pDMCore->ContinueWith(pDMCore, > pDTTManager->GetDialogTaskTreeRoot()); > } > > In our case, this function restarts the PerformTask subtree instead of the > whole tree (the introduction prompt is not in PerformTask). > Of course, you could do other stuff in this function... > > So here is how we solved our problem. I hope that'll help you solve yours. > Let me know if you have questions... > > antoine > > > -----Original Message----- > From: ravenclaw-developers-bounces at LOGANBERRY.srv.cs.cmu.edu > [mailto:ravenclaw-developers-bounces at LOGANBERRY.srv.cs.cmu.edu] On Behalf Of > Svetlana Stenchikova > Sent: Sunday, April 15, 2007 10:30 PM > To: ravenclaw-developers at cs.cmu.edu > Subject: [RavenclawDev 250] checking if an agent has been restarted > > Hi, > > does RavenClaw have any facility to check if the dialog has been > "restarted"? > > I would like to play a different message when the dialog is > 'restarted' than when it is 'started' for the first time, but I do not > see how I can check for that. > > When a user says 'restart' all agents are recreated, so that all > reset, reopen counters start from 0 again. > > I can add to DialogAgent a static variable 'countCreated', which > counts every time any agent is created, but this is not a nice > solution. > > Can someone suggest a better way? > > thank you > Svetlana > > > From antoine at cs.cmu.edu Mon Apr 16 01:03:40 2007 From: antoine at cs.cmu.edu (Antoine Raux) Date: Mon, 16 Apr 2007 01:03:40 -0400 Subject: [RavenclawDev 253] Re: checking if an agent has been restarted In-Reply-To: <9e876f3b0704152141i273c6393l14c51508778f7927@mail.gmail.com> References: <31cecd6b0704151930q3a0ba4b6oba110cd341dadebd@mail.gmail.com> <006501c77fdf$e07929e0$03bd0280@sp.cs.cmu.edu> <9e876f3b0704152141i273c6393l14c51508778f7927@mail.gmail.com> Message-ID: <006601c77fe4$99620f40$03bd0280@sp.cs.cmu.edu> Udhay (and everyone), The difference is that the custom StartOver function gets called by the StartOver library agent, i.e. anytime a user says "START OVER" or something equivalent. To get the same behavior "manually", you'd have to create an agent that gets triggered on such user input, i.e. you'd have to duplicate the generic StartOver library agent. It's precisely in an attempt to keep the StartOver behavior as generic (i.e. task-independent and reusable) as possible that we designed this customizable StartOver function thing. Hope this clarifies things... antoine -----Original Message----- From: udhay.ece at gmail.com [mailto:udhay.ece at gmail.com] On Behalf Of Udhyakumar N Sent: Monday, April 16, 2007 12:41 AM To: Antoine Raux Cc: ravenclaw-developers at cs.cmu.edu Subject: Re: [RavenclawDev 251] Re: checking if an agent has been restarted A small clarification. What is the difference between reopening all the agents except Welcome prompt at the end and the method you just described? -Udhay On 4/16/07, Antoine Raux wrote: > Hi Svetlana, > > We had a similar issue in Let's Go so let me describe it and how we > addressed it. Hopefully that'll help you. > > At the very beginning of the dialog, the system gives an introduction > message ("Welcome to Let's Go (...) To get help say HELP (...)"), which we > do not want to repeat on a start over (in that case we just want "Okay let's > start from the beginning. What can I do for you?"). The solution was to > > 1) define an inform prompt for starting_over as "Okay let's start from the > beginning." (this prompt is automatically spoken by the standard StartOver > agency) > > 2) define a Let's Go specific StartOver function. > The latter is done by adding: > > CUSTOM_START_OVER(LetsGoPublicStartOver) > > to the CORE_CONFIGURATION section, and define a function called > LetsGoPublicStartOver() as follows (sorry for the potential spurious line > breaks...): > > // D: define the start-over routine for lets go public > void LetsGoPublicStartOver() { > // Resets only the subttree in charge of the actual task > // (so as not to repeat the introduction) > CDialogAgent& rda = > > pDTTManager->GetDialogTaskTreeRoot()->A("/LetsGoPublic/PerformTask"); > rda.Reset(); > > pDMCore->PopTopicFromExecutionStack(pDTTManager->GetDialogTaskTreeRoot()); > pDMCore->ContinueWith(pDMCore, > pDTTManager->GetDialogTaskTreeRoot()); > } > > In our case, this function restarts the PerformTask subtree instead of the > whole tree (the introduction prompt is not in PerformTask). > Of course, you could do other stuff in this function... > > So here is how we solved our problem. I hope that'll help you solve yours. > Let me know if you have questions... > > antoine > > > -----Original Message----- > From: ravenclaw-developers-bounces at LOGANBERRY.srv.cs.cmu.edu > [mailto:ravenclaw-developers-bounces at LOGANBERRY.srv.cs.cmu.edu] On Behalf Of > Svetlana Stenchikova > Sent: Sunday, April 15, 2007 10:30 PM > To: ravenclaw-developers at cs.cmu.edu > Subject: [RavenclawDev 250] checking if an agent has been restarted > > Hi, > > does RavenClaw have any facility to check if the dialog has been > "restarted"? > > I would like to play a different message when the dialog is > 'restarted' than when it is 'started' for the first time, but I do not > see how I can check for that. > > When a user says 'restart' all agents are recreated, so that all > reset, reopen counters start from 0 again. > > I can add to DialogAgent a static variable 'countCreated', which > counts every time any agent is created, but this is not a nice > solution. > > Can someone suggest a better way? > > thank you > Svetlana > > > From svetastenchikova at gmail.com Mon Apr 16 14:54:16 2007 From: svetastenchikova at gmail.com (Svetlana Stenchikova) Date: Mon, 16 Apr 2007 14:54:16 -0400 Subject: [RavenclawDev 254] Re: checking if an agent has been restarted In-Reply-To: <006601c77fe4$99620f40$03bd0280@sp.cs.cmu.edu> References: <31cecd6b0704151930q3a0ba4b6oba110cd341dadebd@mail.gmail.com> <006501c77fdf$e07929e0$03bd0280@sp.cs.cmu.edu> <9e876f3b0704152141i273c6393l14c51508778f7927@mail.gmail.com> <006601c77fe4$99620f40$03bd0280@sp.cs.cmu.edu> Message-ID: <31cecd6b0704161154j71e7605cs801d04859e1bf3f@mail.gmail.com> Thanks Antoine, your solution makes sense, however it would require me to make changes to my dialog structure and add a custom start over code. I would like to re-use the generic start-over, I was hoping to get a flag indicating if the system has been start over or not. I guess I will live with my (inelegant) solution for now because I do not want to add any extra agents. Svetlana On 4/16/07, Antoine Raux wrote: > Udhay (and everyone), > > The difference is that the custom StartOver function gets called by the > StartOver library agent, i.e. anytime a user says "START OVER" or something > equivalent. To get the same behavior "manually", you'd have to create an > agent that gets triggered on such user input, i.e. you'd have to duplicate > the generic StartOver library agent. It's precisely in an attempt to keep > the StartOver behavior as generic (i.e. task-independent and reusable) as > possible that we designed this customizable StartOver function thing. > > Hope this clarifies things... > > antoine > > -----Original Message----- > From: udhay.ece at gmail.com [mailto:udhay.ece at gmail.com] On Behalf Of > Udhyakumar N > Sent: Monday, April 16, 2007 12:41 AM > To: Antoine Raux > Cc: ravenclaw-developers at cs.cmu.edu > Subject: Re: [RavenclawDev 251] Re: checking if an agent has been restarted > > A small clarification. > > What is the difference between reopening all the agents except Welcome > prompt at the end and the method you just described? > > -Udhay > > > On 4/16/07, Antoine Raux wrote: > > Hi Svetlana, > > > > We had a similar issue in Let's Go so let me describe it and how we > > addressed it. Hopefully that'll help you. > > > > At the very beginning of the dialog, the system gives an introduction > > message ("Welcome to Let's Go (...) To get help say HELP (...)"), which we > > do not want to repeat on a start over (in that case we just want "Okay > let's > > start from the beginning. What can I do for you?"). The solution was to > > > > 1) define an inform prompt for starting_over as "Okay let's start from the > > beginning." (this prompt is automatically spoken by the standard StartOver > > agency) > > > > 2) define a Let's Go specific StartOver function. > > The latter is done by adding: > > > > CUSTOM_START_OVER(LetsGoPublicStartOver) > > > > to the CORE_CONFIGURATION section, and define a function called > > LetsGoPublicStartOver() as follows (sorry for the potential spurious line > > breaks...): > > > > // D: define the start-over routine for lets go public > > void LetsGoPublicStartOver() { > > // Resets only the subttree in charge of the actual task > > // (so as not to repeat the introduction) > > CDialogAgent& rda = > > > > pDTTManager->GetDialogTaskTreeRoot()->A("/LetsGoPublic/PerformTask"); > > rda.Reset(); > > > > pDMCore->PopTopicFromExecutionStack(pDTTManager->GetDialogTaskTreeRoot()); > > pDMCore->ContinueWith(pDMCore, > > pDTTManager->GetDialogTaskTreeRoot()); > > } > > > > In our case, this function restarts the PerformTask subtree instead of the > > whole tree (the introduction prompt is not in PerformTask). > > Of course, you could do other stuff in this function... > > > > So here is how we solved our problem. I hope that'll help you solve yours. > > Let me know if you have questions... > > > > antoine > > > > > > -----Original Message----- > > From: ravenclaw-developers-bounces at LOGANBERRY.srv.cs.cmu.edu > > [mailto:ravenclaw-developers-bounces at LOGANBERRY.srv.cs.cmu.edu] On Behalf > Of > > Svetlana Stenchikova > > Sent: Sunday, April 15, 2007 10:30 PM > > To: ravenclaw-developers at cs.cmu.edu > > Subject: [RavenclawDev 250] checking if an agent has been restarted > > > > Hi, > > > > does RavenClaw have any facility to check if the dialog has been > > "restarted"? > > > > I would like to play a different message when the dialog is > > 'restarted' than when it is 'started' for the first time, but I do not > > see how I can check for that. > > > > When a user says 'restart' all agents are recreated, so that all > > reset, reopen counters start from 0 again. > > > > I can add to DialogAgent a static variable 'countCreated', which > > counts every time any agent is created, but this is not a nice > > solution. > > > > Can someone suggest a better way? > > > > thank you > > Svetlana > > > > > > > > > From svetastenchikova at gmail.com Mon Apr 16 14:56:30 2007 From: svetastenchikova at gmail.com (Svetlana Stenchikova) Date: Mon, 16 Apr 2007 14:56:30 -0400 Subject: [RavenclawDev 255] making festival pause Message-ID: <31cecd6b0704161156t11070876y43d17c9b77203c20@mail.gmail.com> Hi, I already asked Alan Black this question, but maybe someone here knows the answer.. Is it possible to manually set pauses for Festival? The existing applications use this format to specify a pause: {break time="600ms"/} I am not sure if this was meant for festival or for another TTS, but it does not seem to work with Festival. Is there a way to set a pause length? thank you Svetlana From antoine at cs.cmu.edu Mon Apr 16 15:08:58 2007 From: antoine at cs.cmu.edu (Antoine Raux) Date: Mon, 16 Apr 2007 15:08:58 -0400 Subject: [RavenclawDev 256] Re: checking if an agent has been restarted In-Reply-To: <31cecd6b0704161154j71e7605cs801d04859e1bf3f@mail.gmail.com> References: <31cecd6b0704151930q3a0ba4b6oba110cd341dadebd@mail.gmail.com> <006501c77fdf$e07929e0$03bd0280@sp.cs.cmu.edu> <9e876f3b0704152141i273c6393l14c51508778f7927@mail.gmail.com> <006601c77fe4$99620f40$03bd0280@sp.cs.cmu.edu> <31cecd6b0704161154j71e7605cs801d04859e1bf3f@mail.gmail.com> Message-ID: <009a01c7805a$af952e70$03bd0280@sp.cs.cmu.edu> Hi Svetlana, Actually the solution I described does not require to add any extra agent (although that kind of depends on your task structure). Sorry if I was not clear. Basically all you need to do is a start over function which describes what to do on a start over. The rest is handled by the generic start over library agent. If you send me either a detailed description of what you want to do or your code, I might be able to help you with your specific case... antoine -----Original Message----- From: Svetlana Stenchikova [mailto:svetastenchikova at gmail.com] Sent: Monday, April 16, 2007 2:54 PM To: Antoine Raux Cc: ravenclaw-developers at cs.cmu.edu Subject: Re: [RavenclawDev 253] Re: checking if an agent has been restarted Thanks Antoine, your solution makes sense, however it would require me to make changes to my dialog structure and add a custom start over code. I would like to re-use the generic start-over, I was hoping to get a flag indicating if the system has been start over or not. I guess I will live with my (inelegant) solution for now because I do not want to add any extra agents. Svetlana On 4/16/07, Antoine Raux wrote: > Udhay (and everyone), > > The difference is that the custom StartOver function gets called by the > StartOver library agent, i.e. anytime a user says "START OVER" or something > equivalent. To get the same behavior "manually", you'd have to create an > agent that gets triggered on such user input, i.e. you'd have to duplicate > the generic StartOver library agent. It's precisely in an attempt to keep > the StartOver behavior as generic (i.e. task-independent and reusable) as > possible that we designed this customizable StartOver function thing. > > Hope this clarifies things... > > antoine > > -----Original Message----- > From: udhay.ece at gmail.com [mailto:udhay.ece at gmail.com] On Behalf Of > Udhyakumar N > Sent: Monday, April 16, 2007 12:41 AM > To: Antoine Raux > Cc: ravenclaw-developers at cs.cmu.edu > Subject: Re: [RavenclawDev 251] Re: checking if an agent has been restarted > > A small clarification. > > What is the difference between reopening all the agents except Welcome > prompt at the end and the method you just described? > > -Udhay > > > On 4/16/07, Antoine Raux wrote: > > Hi Svetlana, > > > > We had a similar issue in Let's Go so let me describe it and how we > > addressed it. Hopefully that'll help you. > > > > At the very beginning of the dialog, the system gives an introduction > > message ("Welcome to Let's Go (...) To get help say HELP (...)"), which we > > do not want to repeat on a start over (in that case we just want "Okay > let's > > start from the beginning. What can I do for you?"). The solution was to > > > > 1) define an inform prompt for starting_over as "Okay let's start from the > > beginning." (this prompt is automatically spoken by the standard StartOver > > agency) > > > > 2) define a Let's Go specific StartOver function. > > The latter is done by adding: > > > > CUSTOM_START_OVER(LetsGoPublicStartOver) > > > > to the CORE_CONFIGURATION section, and define a function called > > LetsGoPublicStartOver() as follows (sorry for the potential spurious line > > breaks...): > > > > // D: define the start-over routine for lets go public > > void LetsGoPublicStartOver() { > > // Resets only the subttree in charge of the actual task > > // (so as not to repeat the introduction) > > CDialogAgent& rda = > > > > pDTTManager->GetDialogTaskTreeRoot()->A("/LetsGoPublic/PerformTask"); > > rda.Reset(); > > > > pDMCore->PopTopicFromExecutionStack(pDTTManager->GetDialogTaskTreeRoot()); > > pDMCore->ContinueWith(pDMCore, > > pDTTManager->GetDialogTaskTreeRoot()); > > } > > > > In our case, this function restarts the PerformTask subtree instead of the > > whole tree (the introduction prompt is not in PerformTask). > > Of course, you could do other stuff in this function... > > > > So here is how we solved our problem. I hope that'll help you solve yours. > > Let me know if you have questions... > > > > antoine > > > > > > -----Original Message----- > > From: ravenclaw-developers-bounces at LOGANBERRY.srv.cs.cmu.edu > > [mailto:ravenclaw-developers-bounces at LOGANBERRY.srv.cs.cmu.edu] On Behalf > Of > > Svetlana Stenchikova > > Sent: Sunday, April 15, 2007 10:30 PM > > To: ravenclaw-developers at cs.cmu.edu > > Subject: [RavenclawDev 250] checking if an agent has been restarted > > > > Hi, > > > > does RavenClaw have any facility to check if the dialog has been > > "restarted"? > > > > I would like to play a different message when the dialog is > > 'restarted' than when it is 'started' for the first time, but I do not > > see how I can check for that. > > > > When a user says 'restart' all agents are recreated, so that all > > reset, reopen counters start from 0 again. > > > > I can add to DialogAgent a static variable 'countCreated', which > > counts every time any agent is created, but this is not a nice > > solution. > > > > Can someone suggest a better way? > > > > thank you > > Svetlana > > > > > > > > > From svetastenchikova at gmail.com Tue Apr 17 12:23:18 2007 From: svetastenchikova at gmail.com (Svetlana Stenchikova) Date: Tue, 17 Apr 2007 12:23:18 -0400 Subject: [RavenclawDev 257] Re: receiving messages from INPUT_LINE_CONFIGURATION In-Reply-To: <31cecd6b0704151444x7b48b44brfaa7affd0a481fa6@mail.gmail.com> References: <31cecd6b0704151444x7b48b44brfaa7affd0a481fa6@mail.gmail.com> Message-ID: <31cecd6b0704170923ud49ae5v597fb4b83b8b08cd@mail.gmail.com> Broadcast message is not sent to all servers, but only those specified in broadcast_state of in the cfg file for the server. broadcast_state = sphinx.set_dialog_state;tty-sphinx.set_dialog_state On 4/15/07, Svetlana Stenchikova wrote: > My Dialog manager has statements: > INPUT_LINE_CONFIGURATION("set_grammar=bla") > > These messages should be broadcast to all servers, right? > I am intercepting this message in the ASR server with > serverOpSetDialogState function. > I also get a call in serverOpSetGrammar() in my ASR seerver > > I am now trying to get the same message in the TTY server. I added > the messages in the pgm file, so when the TTY server starts up, it > prints: > > {c JavaTTY > :signatures (("setgrammar" > () > 2 > 6 > () > 2) > ( "processparse" > () > 2 > 6 > () > 2) > ( "speak" > () > 2 > 6 > () > 2) > ( "reinitialize" > () > 2 > 6 > () > 2) > ( "setdialogstate" > () > 2 > 6 > () > 2)) > > > however the tty server does not seem to get neither SetDialogState nor > SetGrammar messages. > > > What could be a reason for the tty server not getting these messages? > > thank you > Svetlana > From svetastenchikova at gmail.com Tue Apr 17 18:28:04 2007 From: svetastenchikova at gmail.com (Svetlana Stenchikova) Date: Tue, 17 Apr 2007 18:28:04 -0400 Subject: [RavenclawDev 258] Re: checking if an agent has been restarted In-Reply-To: <009a01c7805a$af952e70$03bd0280@sp.cs.cmu.edu> References: <31cecd6b0704151930q3a0ba4b6oba110cd341dadebd@mail.gmail.com> <006501c77fdf$e07929e0$03bd0280@sp.cs.cmu.edu> <9e876f3b0704152141i273c6393l14c51508778f7927@mail.gmail.com> <006601c77fe4$99620f40$03bd0280@sp.cs.cmu.edu> <31cecd6b0704161154j71e7605cs801d04859e1bf3f@mail.gmail.com> <009a01c7805a$af952e70$03bd0280@sp.cs.cmu.edu> Message-ID: <31cecd6b0704171528qcef092fo357e472032f23669@mail.gmail.com> Antoine, thank you for clarification. I think that I now understand how to apply your suggestion. Svetlana On 4/16/07, Antoine Raux wrote: > Hi Svetlana, > > Actually the solution I described does not require to add any extra agent > (although that kind of depends on your task structure). Sorry if I was not > clear. > Basically all you need to do is a start over function which describes what > to do on a start over. The rest is handled by the generic start over library > agent. > > If you send me either a detailed description of what you want to do or your > code, I might be able to help you with your specific case... > > antoine > > -----Original Message----- > From: Svetlana Stenchikova [mailto:svetastenchikova at gmail.com] > Sent: Monday, April 16, 2007 2:54 PM > To: Antoine Raux > Cc: ravenclaw-developers at cs.cmu.edu > Subject: Re: [RavenclawDev 253] Re: checking if an agent has been restarted > > Thanks Antoine, > > your solution makes sense, however it would require me to make > changes to my dialog structure and add a custom start over code. > > I would like to re-use the generic start-over, I was hoping to get a > flag indicating if the system has been start over or not. > > I guess I will live with my (inelegant) solution for now because I do > not want to add any extra agents. > > Svetlana > > On 4/16/07, Antoine Raux wrote: > > Udhay (and everyone), > > > > The difference is that the custom StartOver function gets called by the > > StartOver library agent, i.e. anytime a user says "START OVER" or > something > > equivalent. To get the same behavior "manually", you'd have to create an > > agent that gets triggered on such user input, i.e. you'd have to duplicate > > the generic StartOver library agent. It's precisely in an attempt to keep > > the StartOver behavior as generic (i.e. task-independent and reusable) as > > possible that we designed this customizable StartOver function thing. > > > > Hope this clarifies things... > > > > antoine > > > > -----Original Message----- > > From: udhay.ece at gmail.com [mailto:udhay.ece at gmail.com] On Behalf Of > > Udhyakumar N > > Sent: Monday, April 16, 2007 12:41 AM > > To: Antoine Raux > > Cc: ravenclaw-developers at cs.cmu.edu > > Subject: Re: [RavenclawDev 251] Re: checking if an agent has been > restarted > > > > A small clarification. > > > > What is the difference between reopening all the agents except Welcome > > prompt at the end and the method you just described? > > > > -Udhay > > > > > > On 4/16/07, Antoine Raux wrote: > > > Hi Svetlana, > > > > > > We had a similar issue in Let's Go so let me describe it and how we > > > addressed it. Hopefully that'll help you. > > > > > > At the very beginning of the dialog, the system gives an introduction > > > message ("Welcome to Let's Go (...) To get help say HELP (...)"), which > we > > > do not want to repeat on a start over (in that case we just want "Okay > > let's > > > start from the beginning. What can I do for you?"). The solution was to > > > > > > 1) define an inform prompt for starting_over as "Okay let's start from > the > > > beginning." (this prompt is automatically spoken by the standard > StartOver > > > agency) > > > > > > 2) define a Let's Go specific StartOver function. > > > The latter is done by adding: > > > > > > CUSTOM_START_OVER(LetsGoPublicStartOver) > > > > > > to the CORE_CONFIGURATION section, and define a function called > > > LetsGoPublicStartOver() as follows (sorry for the potential spurious > line > > > breaks...): > > > > > > // D: define the start-over routine for lets go public > > > void LetsGoPublicStartOver() { > > > // Resets only the subttree in charge of the actual task > > > // (so as not to repeat the introduction) > > > CDialogAgent& rda = > > > > > > pDTTManager->GetDialogTaskTreeRoot()->A("/LetsGoPublic/PerformTask"); > > > rda.Reset(); > > > > > > > pDMCore->PopTopicFromExecutionStack(pDTTManager->GetDialogTaskTreeRoot()); > > > pDMCore->ContinueWith(pDMCore, > > > pDTTManager->GetDialogTaskTreeRoot()); > > > } > > > > > > In our case, this function restarts the PerformTask subtree instead of > the > > > whole tree (the introduction prompt is not in PerformTask). > > > Of course, you could do other stuff in this function... > > > > > > So here is how we solved our problem. I hope that'll help you solve > yours. > > > Let me know if you have questions... > > > > > > antoine > > > > > > > > > -----Original Message----- > > > From: ravenclaw-developers-bounces at LOGANBERRY.srv.cs.cmu.edu > > > [mailto:ravenclaw-developers-bounces at LOGANBERRY.srv.cs.cmu.edu] On > Behalf > > Of > > > Svetlana Stenchikova > > > Sent: Sunday, April 15, 2007 10:30 PM > > > To: ravenclaw-developers at cs.cmu.edu > > > Subject: [RavenclawDev 250] checking if an agent has been restarted > > > > > > Hi, > > > > > > does RavenClaw have any facility to check if the dialog has been > > > "restarted"? > > > > > > I would like to play a different message when the dialog is > > > 'restarted' than when it is 'started' for the first time, but I do not > > > see how I can check for that. > > > > > > When a user says 'restart' all agents are recreated, so that all > > > reset, reopen counters start from 0 again. > > > > > > I can add to DialogAgent a static variable 'countCreated', which > > > counts every time any agent is created, but this is not a nice > > > solution. > > > > > > Can someone suggest a better way? > > > > > > thank you > > > Svetlana > > > > > > > > > > > > > > > > > > From tk at edam.speech.cs.cmu.edu Wed Apr 18 00:07:46 2007 From: tk at edam.speech.cs.cmu.edu (tk@edam.speech.cs.cmu.edu) Date: Wed, 18 Apr 2007 00:07:46 -0400 Subject: [RavenclawDev 259] [22] Tools/RCTaskViz/RCTaskViz.pl: 1) made grammar printing an option ( -g on the command line) Message-ID: <200704180407.l3I47kmD026866@edam.speech.cs.cmu.edu> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/ravenclaw-developers/attachments/20070418/aebeccd7/attachment.html -------------- next part -------------- Modified: Tools/RCTaskViz/RCTaskViz.pl =================================================================== --- Tools/RCTaskViz/RCTaskViz.pl 2007-04-13 21:22:37 UTC (rev 21) +++ Tools/RCTaskViz/RCTaskViz.pl 2007-04-18 04:07:44 UTC (rev 22) @@ -4,13 +4,16 @@ use strict; use GraphViz; +use Getopt::Std; -my $g = GraphViz->new(directed => 1, layout => 'dot'); - -die "usage: $0 {dialog task filename}$/" if !@ARGV; +my %options=(); +getopts('g',\%options); +die "usage: $0 -g {dialog task filename}$/" if !@ARGV; my $taskfile = shift; open(TASKFILE, $taskfile) || die "could not open taskfile '$taskfile'$/"; +my $g = GraphViz->new(directed => 1, layout => 'dot', rankdir => 'LR'); + my $MAX_LABEL = 55; my @defaultattr = (shape => 'box', style => 'filled'); @@ -95,7 +98,7 @@ $gref .= $1; #print "adding '$1'$/"; } - if($gref) { + if($options{'g'} && $gref) { if(length($gref) > $MAX_LABEL) { $gref = substr($gref, 0, $MAX_LABEL-3).'...'; } From tk at edam.speech.cs.cmu.edu Wed Apr 18 00:13:05 2007 From: tk at edam.speech.cs.cmu.edu (tk@edam.speech.cs.cmu.edu) Date: Wed, 18 Apr 2007 00:13:05 -0400 Subject: [RavenclawDev 260] [23] Tools: Message-ID: <200704180413.l3I4D5qf026887@edam.speech.cs.cmu.edu> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/ravenclaw-developers/attachments/20070418/ea8e334c/attachment.html -------------- next part -------------- Property changes on: Tools/MakeLM ___________________________________________________________________ Name: svn:ignore + log.txt *.idngram temp.ccs tempfile vocab Property changes on: Tools/RCTaskViz ___________________________________________________________________ Name: svn:ignore + taskviz.png taskviz.txt Thumbs.db From tk at edam.speech.cs.cmu.edu Thu Apr 19 13:26:05 2007 From: tk at edam.speech.cs.cmu.edu (tk@edam.speech.cs.cmu.edu) Date: Thu, 19 Apr 2007 13:26:05 -0400 Subject: [RavenclawDev 261] [24] Tools/RCTaskViz: 1) Added support for graph labels Message-ID: <200704191726.l3JHQ5R9000564@edam.speech.cs.cmu.edu> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/ravenclaw-developers/attachments/20070419/a658dac2/attachment-0001.html -------------- next part -------------- Added: Tools/RCTaskViz/GraphViz.pm =================================================================== --- Tools/RCTaskViz/GraphViz.pm (rev 0) +++ Tools/RCTaskViz/GraphViz.pm 2007-04-19 17:26:04 UTC (rev 24) @@ -0,0 +1,1254 @@ +package GraphViz; + +use strict; +use vars qw($AUTOLOAD $VERSION); + +use Carp; +use Config; +use IPC::Run qw(run binary); + +# This is incremented every time there is a change to the API +$VERSION = '2.02'; + +=head1 NAME + +GraphViz - Interface to the GraphViz graphing tool + +=head1 SYNOPSIS + + use GraphViz; + + my $g = GraphViz->new(); + + $g->add_node('London'); + $g->add_node('Paris', label => 'City of\nlurve'); + $g->add_node('New York'); + + $g->add_edge('London' => 'Paris'); + $g->add_edge('London' => 'New York', label => 'Far'); + $g->add_edge('Paris' => 'London'); + + print $g->as_png; + + +=head1 DESCRIPTION + +This module provides an interface to layout and image generation of directed +and undirected graphs in a variety of formats (PostScript, PNG, etc.) using the +"dot", "neato", "twopi", "circo" and "fdp" programs from the GraphViz project +(http://www.graphviz.org/ or http://www.research.att.com/sw/tools/graphviz/). + +=head2 What is a graph? + +A (undirected) graph is a collection of nodes linked together with +edges. + +A directed graph is the same as a graph, but the edges have a +direction. + +=head2 What is GraphViz? + +This module is an interface to the GraphViz toolset +(http://www.graphviz.org/). The GraphViz tools provide automatic graph +layout and drawing. This module simplifies the creation of graphs and +hides some of the complexity of the GraphViz module. + +Laying out graphs in an aesthetically-pleasing way is a hard problem - +there may be multiple ways to lay out the same graph, each with their +own quirks. GraphViz luckily takes part of this hard problem and does +a pretty good job in a couple of seconds for most graphs. + +=head2 Why should I use this module? + +Observation aids comprehension. That is a fancy way of expressing +that popular faux-Chinese proverb: "a picture is worth a thousand +words". + +Text is not always the best way to represent anything and everything +to do with a computer programs. Pictures and images are easier to +assimilate than text. The ability to show a particular thing +graphically can aid a great deal in comprehending what that thing +really represents. + +Diagrams are computationally efficient, because information can be +indexed by location; they group related information in the same +area. They also allow relations to be expressed between elements +without labeling the elements. + +A friend of mine used this to his advantage when trying to remember +important dates in computer history. Instead of sitting down and +trying to remember everything, he printed over a hundred posters (each +with a date and event) and plastered these throughout his house. His +spatial memory is still so good that asked last week (more than a year +since the experiment) when Lisp was invented, he replied that it was +upstairs, around the corner from the toilet, so must have been around +1958. + +Spreadsheets are also a wonderfully simple graphical representation of +computational models. + +=head2 Applications + +Bundled with this module are several modules to help graph data +structures (GraphViz::Data::Dumper), XML (GraphViz::XML), and +Parse::RecDescent, Parse::Yapp, and yacc grammars +(GraphViz::Parse::RecDescent, GraphViz::Parse::Yapp, and +GraphViz::Parse::Yacc). + +Note that Marcel Grunauer has released some modules on CPAN to graph +various other structures. See GraphViz::DBI and GraphViz::ISA for +example. + +brian d foy has written an article about Devel::GraphVizProf for +Dr. Dobb's Journal: +http://www.ddj.com/columns/perl/2001/0104pl002/0104pl002.htm + +=head2 Award winning! + +I presented a paper and talk on "Graphing Perl" using GraphViz at the +3rd German Perl Workshop and received the "Best Knowledge Transfer" +prize. + + Talk: http://www.astray.com/graphing_perl/graphing_perl.pdf + Slides: http://www.astray.com/graphing_perl/ + +=head1 METHODS + +=head2 new + +This is the constructor. It accepts several attributes. + + my $g = GraphViz->new(); + my $g = GraphViz->new(directed => 0); + my $g = GraphViz->new(layout => 'neato', ratio => 'compress'); + my $g = GraphViz->new(rankdir => 1); + my $g = GraphViz->new(width => 8.5, height => 11); + my $g = GraphViz->new(width => 30, height => 20, + pagewidth => 8.5, pageheight => 11); + +The most two important attributes are 'layout' and 'directed'. + +=over + +=item layout + +The 'layout' attribute determines which layout algorithm GraphViz.pm will +use. Possible values are: + +=over + +=item dot + +The default GraphViz layout for directed graph layouts + +=item neato + +For undirected graph layouts - spring model + +=item twopi + +For undirected graph layouts - radial + +=item circo + +For undirected graph layouts - circular + +=item fdp + +For undirected graph layouts - force directed spring model + +=back + +=item directed + +The 'directed' attribute, which defaults to 1 (true) specifies +directed (edges have arrows) graphs. Setting this to zero produces +undirected graphs (edges do not have arrows). + +=item rankdir + +Another attribute 'rankdir' controls the direction the nodes are linked +together. If true it will do left->right linking rather than the +default up-down linking. + +=item width, height + +The 'width' and 'height' attributes control the size of the bounding +box of the drawing in inches. This is more useful for PostScript +output as for raster graphic (such as PNG) the pixel dimensions +can not be set, although there are generally 96 pixels per inch. + +=item pagewidth, pageheight + +The 'pagewidth' and 'pageheight' attributes set the PostScript +pagination size in inches. That is, if the image is larger than the +page then the resulting PostScript image is a sequence of pages that +can be tiled or assembled into a mosaic of the full image. (This only +works for PostScript output). + + +=item concentrate + +The 'concentrate' attribute controls enables an edge merging technique +to reduce clutter in dense layouts of directed graphs. The default is +not to merge edges. + +=item random_start + +For undirected graphs, the 'random_start' attribute requests an +initial random placement for the graph, which may give a better +result. The default is not random. + +=item epsilon + +For undirected graphs, the 'epsilon' attribute decides how long the +graph solver tries before finding a graph layout. Lower numbers allow +the solver to fun longer and potentially give a better layout. Larger +values can decrease the running time but with a reduction in layout +quality. The default is 0.1. + +=item overlap + +The 'overlap' option allows you to set layout behavior for graph nodes +that overlap. (From GraphViz documentation:) + +Determines if and how node overlaps should be removed. + + +=over + +=item true + +(the default) overlaps are retained. + +=item scale + +overlaps are removed by uniformly scaling in x and y. + +=item false + +If the value converts to "false", node overlaps are removed by a Voronoi-based technique. + +=item scalexy + +x and y are separately scaled to remove overlaps. + +=item orthoxy, orthxy + +If the value is "orthoxy" or "orthoyx", overlaps are moved by optimizing two +constraint problems, one for the x axis and one for the y. The suffix indicates +which axis is processed first. + +B: The methods related to "orthoxy" and "orthoyx" are still evolving. The +semantics of these may change, or these methods may disappear altogether. + +=item compress + +If the value is "compress", the layout will be scaled down as much as possible +without introducing any overlaps. + +=back + +Except for the Voronoi method, all of these transforms preserve the orthogonal +ordering of the original layout. That is, if the x coordinates of two nodes are +originally the same, they will remain the same, and if the x coordinate of one +node is originally less than the x coordinate of another, this relation will +still hold in the transformed layout. The similar properties hold for the y +coordinates. + +=item no_overlap + +The 'no_overlap' overlap option, if set, tells the graph solver to not +overlap the nodes. Deprecated, Use 'overlap' => 'false'. + +=item ratio + +The 'ratio' option sets the aspect ratio (drawing height/drawing width) for the +drawing. Note that this is adjusted before the size attribute constraints are +enforced. Default value is C. + +=over + +=item numeric + +If ratio is numeric, it is taken as the desired aspect ratio. Then, if the +actual aspect ratio is less than the desired ratio, the drawing height is +scaled up to achieve the desired ratio; if the actual ratio is greater than +that desired ratio, the drawing width is scaled up. + +=item fill + +If ratio = C and the size attribute is set, node positions are scaled, +separately in both x and y, so that the final drawing exactly fills the +specified size. + +=item compress + +If ratio = C and the size attribute is set, dot attempts to compress +the initial layout to fit in the given size. This achieves a tighter packing of +nodes but reduces the balance and symmetry. This feature only works in dot. + +=item expand + +If ratio = C the size attribute is set, and both the width and the +height of the graph are less than the value in size, node positions are scaled +uniformly until at least one dimension fits size exactly. Note that this is +distinct from using size as the desired size, as here the drawing is expanded +before edges are generated and all node and text sizes remain unchanged. + +=item auto + +If ratio = C the page attribute is set and the graph cannot be drawn on a +single page, then size is set to an ``ideal'' value. In particular, the size in +a given dimension will be the smallest integral multiple of the page size in +that dimension which is at least half the current size. The two dimensions are +then scaled independently to the new size. This feature only works in dot. + +=back + +=item bgcolor + +The 'bgcolor' option sets the background colour. A colour value may be +"h,s,v" (hue, saturation, brightness) floating point numbers between 0 +and 1, or an X11 color name such as 'white', 'black', 'red', 'green', +'blue', 'yellow', 'magenta', 'cyan', or 'burlywood'. + +=item node,edge,graph + +The 'node', 'edge' and 'graph' attributes allow you to specify global +node, edge and graph attributes (in addition to those controlled by +the special attributes described above). The value should be a hash +reference containing the corresponding key-value pairs. For example, +to make all nodes box-shaped (unless explicity given another shape): + + my $g = GraphViz->new(node => {shape => 'box'}); + +=back + +=cut + + +sub new { + my $proto = shift; + my $config = shift; + my $class = ref($proto) || $proto; + my $self = {}; + + # Cope with the old hashref format + if (ref($config) ne 'HASH') { + my %config; + %config = ($config, @_) if @_; + $config = \%config; + } + + $self->{NODES} = {}; + $self->{NODELIST} = []; + $self->{EDGES} = []; + + if (exists $config->{directed}) { + $self->{DIRECTED} = $config->{directed}; + } else { + $self->{DIRECTED} = 1; # default to directed + } + + if (exists $config->{layout}) { + $self->{LAYOUT} = $config->{layout}; + } else { + $self->{LAYOUT} = "dot"; # default layout + } + + if (exists $config->{bgcolor}) { + $self->{BGCOLOR} = $config->{bgcolor}; + } + + $self->{RANK_DIR} = $config->{rankdir} if (exists $config->{rankdir}); + + $self->{UNFLATTEN} = exists $config->{unflatten}; + $self->{LABEL} = $config->{label} if (exists $config->{label}); + + $self->{WIDTH} = $config->{width} if (exists $config->{width}); + $self->{HEIGHT} = $config->{height} if (exists $config->{height}); + + $self->{PAGEWIDTH} = $config->{pagewidth} if (exists $config->{pagewidth}); + $self->{PAGEHEIGHT} = $config->{pageheight} if (exists $config->{pageheight}); + + $self->{CONCENTRATE} = $config->{concentrate} if (exists $config->{concentrate}); + + $self->{RANDOM_START} = $config->{random_start} if (exists $config->{random_start}); + + $self->{EPSILON} = $config->{epsilon} if (exists $config->{epsilon}); + + $self->{SORT} = $config->{sort} if (exists $config->{sort}); + + $self->{OVERLAP} = $config->{overlap} if (exists $config->{overlap}); + # no_overlap overrides overlap setting. + $self->{OVERLAP} = 'false' if (exists $config->{no_overlap}); + + $self->{RATIO} = $config->{ratio} || 'fill'; + + # Global node, edge and graph attributes + $self->{NODE_ATTRS} = $config->{node} if (exists $config->{node}); + $self->{EDGE_ATTRS} = $config->{edge} if (exists $config->{edge}); + $self->{GRAPH_ATTRS} = $config->{graph} if (exists $config->{graph}); + + bless($self, $class); + return $self; +} + + +=head2 add_node + +A graph consists of at least one node. All nodes have a name attached +which uniquely represents that node. + +The add_node method creates a new node and optionally assigns it +attributes. + +The simplest form is used when no attributes are required, in which +the string represents the name of the node: + + $g->add_node('Paris'); + +Various attributes are possible: "label" provides a label for the node +(the label defaults to the name if none is specified). The label can +contain embedded newlines with '\n', as well as '\c', '\l', '\r' for +center, left, and right justified lines: + + $g->add_node('Paris', label => 'City of\nlurve'); + +Attributes need not all be specified in the one line: successive +declarations of the same node have a cumulative effect, in that any +later attributes are just added to the existing ones. For example, the +following two lines are equivalent to the one above: + + $g->add_node('Paris'); + $g->add_node('Paris', label => 'City of\nlurve'); + +Note that multiple attributes can be specified. Other attributes +include: + +=over 4 + +=item height, width + +sets the minimum height or width + +=item shape + +sets the node shape. This can be one of: 'record', 'plaintext', +'ellipse', 'circle', 'egg', 'triangle', 'box', 'diamond', 'trapezium', +'parallelogram', 'house', 'hexagon', 'octagon' + +=item fontsize + +sets the label size in points + +=item fontname + +sets the label font family name + +=item color + +sets the outline colour, and the default fill colour if the 'style' is +'filled' and 'fillcolor' is not specified + +A colour value may be "h,s,v" (hue, saturation, brightness) floating +point numbers between 0 and 1, or an X11 color name such as 'white', +'black', 'red', 'green', 'blue', 'yellow', 'magenta', 'cyan', or +'burlywood' + +=item fillcolor + +sets the fill colour when the style is 'filled'. If not specified, the +'fillcolor' when the 'style' is 'filled' defaults to be the same as +the outline color + +=item style + +sets the style of the node. Can be one of: 'filled', 'solid', +'dashed', 'dotted', 'bold', 'invis' + +=item URL + +sets the url for the node in image map and PostScript files. The +string '\N' value will be replaced by the node name. In PostScript +files, URL information is embedded in such a way that Acrobat +Distiller creates PDF files with active hyperlinks + +=back + +If you wish to add an anonymous node, that is a node for which you do +not wish to generate a name, you may use the following form, where the +GraphViz module generates a name and returns it for you. You may then +use this name later on to refer to this node: + + my $nodename = $g->add_node('label' => 'Roman city'); + +Nodes can be clustered together with the "cluster" attribute, which is +drawn by having a labelled rectangle around all the nodes in a +cluster. An empty string means not clustered. + + $g->add_node('London', cluster => 'Europe'); + $g->add_node('Amsterdam', cluster => 'Europe'); + +Clusters can also take a hashref so that you can set attributes: + + my $eurocluster = { + name =>'Europe', + style =>'filled', + fillcolor =>'lightgray', + fontname =>'arial', + fontsize =>'12', + }; + $g->add_node('London', cluster => $eurocluster, @default_attrs); + + +Nodes can be located in the same rank (that is, at the same level in +the graph) with the "rank" attribute. Nodes with the same rank value +are ranked together. + + $g->add_node('Paris', rank => 'top'); + $g->add_node('Boston', rank => 'top'); + +Also, nodes can consist of multiple parts (known as ports). This is +implemented by passing an array reference as the label, and the parts +are displayed as a label. GraphViz has a much more complete port +system, this is just a simple interface to it. See the 'from_port' and +'to_port' attributes of add_edge: + + $g->add_node('London', label => ['Heathrow', 'Gatwick']); + +=cut + +sub add_node { + my $self = shift; + my $node = shift; + + # Cope with the new simple notation + if (ref($node) ne 'HASH') { + my $name = $node; + my %node; + if (@_ % 2 == 1) { + # No name passed + %node = ($name, @_); + } else { + # Name passed + %node = (@_, name => $name); + } + $node = \%node; + } + + $self->add_node_munge($node) if $self->can('add_node_munge'); + + # The _code attribute is our internal name for the node + $node->{_code} = $self->_quote_name($node->{name}); + + if (not exists $node->{name}) { + $node->{name} = $node->{_code}; + } + + if (not exists $node->{label}) { + if (exists $self->{NODES}->{$node->{name}} and defined $self->{NODES}->{$node->{name}}->{label}) { + # keep our old label if we already exist + $node->{label} = $self->{NODES}->{$node->{name}}->{label}; + } else { + $node->{label} = $node->{name}; + } + } else { + $node->{label} =~ s#([|<>\[\]{}"])#\\$1#g unless $node->{shape} && + ($node->{shape} eq 'record' || ($node->{label} =~ /^<{shape} eq + 'plaintext')); + } + + delete $node->{cluster} + if exists $node->{cluster} && !length $node->{cluster} ; + + $node->{_label} = $node->{label}; + + # Deal with ports + if (ref($node->{label}) eq 'ARRAY') { + $node->{shape} = 'record'; # force a record + my $nports = 0; + $node->{label} = join '|', map + { $_ =~ s#([|<>\[\]{}"])#\\$1#g; '' . $_ } + (@{$node->{label}}); + } + + # Save ourselves + if (!exists($self->{NODES}->{$node->{name}})) { + $self->{NODES}->{$node->{name}} = $node; + } else { + # If the node already exists, add or overwrite attributes. + foreach (keys %$node) { + $self->{NODES}->{$node->{name}}->{$_} = $node->{$_}; + } + } + + $self->{CODES}->{$node->{_code}} = $node->{name}; + + # Add the node to the nodelist, which contains the names of + # all the nodes in the order that they were inserted (but only + # if it's not already there) + push @{$self->{NODELIST}}, $node->{name} unless + grep { $_ eq $node->{name} } @{$self->{NODELIST}}; + + return $node->{name}; +} + + +=head2 add_edge + +Edges are directed (or undirected) links between nodes. This method +creates a new edge between two nodes and optionally assigns it +attributes. + +The simplest form is when now attributes are required, in which case +the nodes from and to which the edge should be are specified. This +works well visually in the program code: + + $g->add_edge('London' => 'Paris'); + +Attributes such as 'label' can also be used. This specifies a label +for the edge. The label can contain embedded newlines with '\n', as +well as '\c', '\l', '\r' for center, left, and right justified lines. + + $g->add_edge('London' => 'New York', label => 'Far'); + +Note that multiple attributes can be specified. Other attributes +include: + +=over 4 + +=item minlen + +sets an integer factor that applies to the edge length (ranks for +normal edges, or minimum node separation for flat edges) + +=item weight + +sets the integer cost of the edge. Values greater than 1 tend to +shorten the edge. Weight 0 flat edges are ignored for ordering +nodes + +=item fontsize + +sets the label type size in points + +=item fontname + +sets the label font family name + +=item fontcolor + +sets the label text colour + +=item color + +sets the line colour for the edge + +A colour value may be "h,s,v" (hue, saturation, brightness) floating +point numbers between 0 and 1, or an X11 color name such as 'white', +'black', 'red', 'green', 'blue', 'yellow', 'magenta', 'cyan', or +'burlywood' + +=item style + +sets the style of the node. Can be one of: 'filled', 'solid', +'dashed', 'dotted', 'bold', 'invis' + + +=item dir + +sets the arrow direction. Can be one of: 'forward', 'back', 'both', 'none' + +=item tailclip, headclip + +when set to false disables endpoint shape clipping + +=item arrowhead, arrowtail + +sets the type for the arrow head or tail. Can be one of: 'none', +'normal', 'inv', 'dot', 'odot', 'invdot', 'invodot.' + +=item arrowsize + +sets the arrow size: (norm_length=10,norm_width=5, +inv_length=6,inv_width=7,dot_radius=2) + +=item headlabel, taillabel + +sets the text for port labels. Note that labelfontcolor, +labelfontname, labelfontsize are also allowed + +=item labeldistance, port_label_distance + +sets the distance from the edge / port to the label. Also labelangle + +=item decorateP + +if set, draws a line from the edge to the label + +=item samehead, sametail + +if set aim edges having the same value to the same port, using the +average landing point + +=item constraint + +if set to false causes an edge to be ignored for rank assignment + +=back + +Additionally, adding edges between ports of a node is done via the +'from_port' and 'to_port' parameters, which currently takes in the +offset of the port (ie 0, 1, 2...). + + $g->add_edge('London' => 'Paris', from_port => 0); + +=cut + +sub add_edge { + my $self = shift; + my $edge = shift; + + # Also cope with simple $from => $to + if (ref($edge) ne 'HASH') { + my $from = $edge; + my %edge = (from => $from, to => shift, @_); + $edge = \%edge; + } + + $self->add_edge_munge($edge) if $self->can('add_edge_munge'); + + if (not exists $edge->{from} or not exists $edge->{to}) { + carp("GraphViz add_edge: 'from' or 'to' parameter missing!"); + return; + } + + my $from = $edge->{from}; + my $to = $edge->{to}; + $self->add_node($from) unless exists $self->{NODES}->{$from}; + $self->add_node($to) unless exists $self->{NODES}->{$to}; + + push @{$self->{EDGES}}, $edge; # should remove! +} + + +=head2 as_canon, as_text, as_gif etc. methods + +There are a number of methods which generate input for dot / neato / +twopi / circo / fdp or output the graph in a variety of formats. + +Note that if you pass a filename, the data is written to that +filename. If you pass a filehandle, the data will be streamed to the +filehandle. If you pass a scalar reference, then the data will be +stored in that scalar. If you pass it a code reference, then it is +called with the data (note that the coderef may be called multiple +times if the image is large). Otherwise, the data is returned: + +B you will probably want to binmode any filehandles you write +the output to if you want your application to be portable to Win32. + + my $png_image = $g->as_png; + # or + $g->as_png("pretty.png"); # save image + # or + $g->as_png(\*STDOUT); # stream image to a filehandle + # or + #g->as_png(\$text); # save data in a scalar + # or + $g->as_png(sub { $png_image .= shift }); + +=over 4 + +=item as_debug + +The as_debug method returns the dot file which we pass to GraphViz. It +does not lay out the graph. This is mostly useful for debugging. + + print $g->as_debug; + +=item as_canon + +The as_canon method returns the canonical dot / neato / twopi / circo / fdp file +which corresponds to the graph. It does not layout the graph - every +other as_* method does. + + print $g->as_canon; + + + # prints out something like: + digraph test { + node [ label = "\N" ]; + London [label=London]; + Paris [label="City of\nlurve"]; + New_York [label="New York"]; + London -> Paris; + London -> New_York [label=Far]; + Paris -> London; + } + +=item as_text + +The as_text method returns text which is a layed-out dot / neato / +twopi / circo / fdp format file. + + print $g->as_text; + + # prints out something like: + digraph test { + node [ label = "\N" ]; + graph [bb= "0,0,162,134"]; + London [label=London, pos="33,116", width="0.89", height="0.50"]; + Paris [label="City of\nlurve", pos="33,23", width="0.92", height="0.62"]; + New_York [label="New York", pos="123,23", width="1.08", height="0.50"]; + London -> Paris [pos="e,27,45 28,98 26,86 26,70 27,55"]; + London -> New_York [label=Far, pos="e,107,40 49,100 63,85 84,63 101,46", lp="99,72"]; + Paris -> London [pos="s,38,98 39,92 40,78 40,60 39,45"]; + } + +=item as_ps + +Returns a string which contains a layed-out PostScript-format file. + + print $g->as_ps; + +=item as_hpgl + +Returns a string which contains a layed-out HP pen plotter-format file. + + print $g->as_hpgl; + +=item as_pcl + +Returns a string which contains a layed-out Laserjet printer-format file. + + print $g->as_pcl; + +=item as_mif + +Returns a string which contains a layed-out FrameMaker graphics-format file. + + print $g->as_mif; + +=item as_pic + +Returns a string which contains a layed-out PIC-format file. + + print $g->as_pic; + +=item as_gd + +Returns a string which contains a layed-out GD-format file. + + print $g->as_gd; + +=item as_gd2 + +Returns a string which contains a layed-out GD2-format file. + + print $g->as_gd2; + +=item as_gif + +Returns a string which contains a layed-out GIF-format file. + + print $g->as_gif; + +=item as_jpeg + +Returns a string which contains a layed-out JPEG-format file. + + print $g->as_jpeg; + +=item as_png + +Returns a string which contains a layed-out PNG-format file. + + print $g->as_png; + $g->as_png("pretty.png"); # save image + + +=item as_wbmp + +Returns a string which contains a layed-out Windows BMP-format file. + + print $g->as_wbmp; + +=item as_cmap (deprecated) + +Returns a string which contains a layed-out HTML client-side image map +format file. Use as_cmpax instead. + + print $g->as_cmap; + +=item as_cmapx + +Returns a string which contains a layed-out HTML HTML/X client-side image map +format file. + + print $g->as_cmapx; + +=item as_ismap (deprecated) + +Returns a string which contains a layed-out old-style server-side +image map format file. Use as_imap instead. + + print $g->as_ismap; + +=item as_imap + +Returns a string which contains a layed-out HTML new-style server-side +image map format file. + + print $g->as_imap; + +=item as_vrml + +Returns a string which contains a layed-out VRML-format file. + + print $g->as_vrml; + +=item as_vtx + +Returns a string which contains a layed-out VTX (Visual Thought) +format file. + + print $g->as_vtx; + +=item as_mp + +Returns a string which contains a layed-out MetaPost-format file. + + print $g->as_mp; + +=item as_fig + +Returns a string which contains a layed-out FIG-format file. + + print $g->as_fig; + +=item as_svg + +Returns a string which contains a layed-out SVG-format file. + + print $g->as_svg; + +=item as_svgz + +Returns a string which contains a layed-out SVG-format file +that is compressed. + + print $g->as_svgz; + +=item as_plain + +Returns a string which contains a layed-out simple-format file. + + print $g->as_plain; + +=back + +=cut + +# Generate magic methods to save typing + +sub AUTOLOAD { + my $self = shift; + my $type = ref($self) + or croak("$self is not an object"); + my $output = shift; + + my $name = $AUTOLOAD; + $name =~ s/.*://; # strip fully-qualified portion + + return if $name =~ /DESTROY/; + + if ($name eq 'as_text') { + $name = "as_dot"; + } + + if ($name =~ /^as_(ps|hpgl|pcl|mif|pic|gd|gd2|gif|jpeg|png|wbmp|cmapx?|ismap|imap|vrml|vtx|mp|fig|svgz?|dot|canon|plain)$/) { + my $data = $self->_as_generic('-T' . $1, $self->_as_debug, $output); + return $data; + } + + croak "Method $name not defined!"; +} + + +# Return the main dot text +sub as_debug { + my $self = shift; + return $self->_as_debug(@_); +} + +sub _as_debug { + my $self = shift; + + my $dot; + + my $graph_type = $self->{DIRECTED} ? 'digraph' : 'graph'; + + $dot .= "$graph_type test {\n"; + + # the direction of the graph + $dot .= "\trankdir=LR;\n" if $self->{RANK_DIR}; + + # graph label + $dot .= "\tlabel=\"". $self->{LABEL} . "\";\n" if $self->{LABEL}; + + # the size of the graph + $dot .= "\tsize=\"" . $self->{WIDTH} . "," . $self->{HEIGHT} ."\";\n" if $self->{WIDTH} && $self->{HEIGHT}; + $dot .= "\tpage=\"" . $self->{PAGEWIDTH} . "," . $self->{PAGEHEIGHT} ."\";\n" if $self->{PAGEWIDTH} && $self->{PAGEHEIGHT}; + + # Ratio setting + $dot .= "\tratio=\"" . $self->{RATIO}; + #if($self->{UNFLATTEN}) { + # $dot .= ", unflatten"; + #} + $dot .= "\";\n"; + + # unflatten? + #$dot .= "\tunflatten=true;\n" if $self->{UNFLATTEN}; + #$dot .= "\tunflatten;\n" if $self->{UNFLATTEN}; + + # edge merging + $dot .= "\tconcentrate=true;\n" if $self->{CONCENTRATE}; + + # epsilon + $dot .= "\tepsilon=" . $self->{EPSILON} . ";\n" if $self->{EPSILON}; + + # random start + $dot .= "\tstart=rand;\n" if $self->{RANDOM_START}; + + # overlap + $dot .= "\toverlap=\"" . $self->{OVERLAP} . "\";\n" if $self->{OVERLAP}; + + # color, bgcolor + $dot .= "\tbgcolor=\"" . $self->{BGCOLOR} . "\";\n" if $self->{BGCOLOR}; + + # Global node, edge and graph attributes + $dot .= "\tnode" . _attributes($self->{NODE_ATTRS}) . ";\n" + if exists($self->{NODE_ATTRS}); + $dot .= "\tedge" . _attributes($self->{EDGE_ATTRS}) . ";\n" + if exists($self->{EDGE_ATTRS}); + $dot .= "\tgraph" . _attributes($self->{GRAPH_ATTRS}) . ";\n" + if exists($self->{GRAPH_ATTRS}); + + my %clusters = (); + my %cluster_nodes = (); + my %clusters_edge = (); + + my $arrow = $self->{DIRECTED} ? ' -> ' : ' -- '; + + # Add all the nodes + my @nodelist = @{$self->{NODELIST}}; + @nodelist = sort @nodelist if $self->{SORT}; + + foreach my $name (@nodelist) { + my $node = $self->{NODES}->{$name}; + + # Note all the clusters + if (exists $node->{cluster} && $node->{cluster}) { + # map "name" to value in case cluster attribute is not a simple string + $clusters{$node->{cluster}} = $node->{cluster}; + push @{$cluster_nodes{$node->{cluster}}}, $name; + next; + } + + $dot .= "\t" . $node->{_code} . _attributes($node) . ";\n"; + } + + # Add all the edges + foreach my $edge (sort { $a->{from} cmp $b->{from} || $a->{to} cmp $b->{to} } @{$self->{EDGES}}) { + + my $from = $self->{NODES}->{$edge->{from}}->{_code}; + my $to = $self->{NODES}->{$edge->{to}}->{_code}; + + # Deal with ports + if (exists $edge->{from_port}) { + $from = '"' . $from . '"' . ':port' . $edge->{from_port}; + } + if (exists $edge->{to_port}) { + $to = '"' . $to . '"' . ':port' . $edge->{to_port}; + } + + if (exists $self->{NODES}->{$from} && exists $self->{NODES}->{$from}->{cluster} + && exists $self->{NODES}->{$to} && exists $self->{NODES}->{$to}->{cluster} && + $self->{NODES}->{$from}->{cluster} eq $self->{NODES}->{$to}->{cluster}) { + + $clusters_edge{$self->{NODES}->{$from}->{cluster}} .= "\t\t" . $from . $arrow . $to . _attributes($edge) . ";\n"; + } else { + $dot .= "\t" . $from . $arrow . $to . _attributes($edge) . ";\n"; + } + } + + foreach my $clustername (sort keys %cluster_nodes) { + my $cluster = $clusters{$clustername}; + my $attrs; + my $name; + if (ref($cluster) eq 'HASH') { + if (exists $cluster->{label}) { + $name = $cluster->{label}; + } + elsif (exists $cluster->{name}) { + # "coerce" name attribute into label attribute + $name = $cluster->{name}; + $cluster->{label} = $name; + delete $cluster->{name}; + } + $attrs = _attributes($cluster); + } else { + $name = $cluster; + $attrs = _attributes({ label => $cluster}); + } + # rewrite attributes string slightly + $attrs =~ s/^\s\[//o; + $attrs =~ s/,/;/go; + $attrs =~ s/\]$//o; + + $dot .= "\tsubgraph cluster_" . $self->_quote_name($name) . " {\n"; + $dot .= "\t\t$attrs;\n"; + $dot .= join "", map { "\t\t" . $self->{NODES}->{$_}->{_code} . _attributes($self->{NODES}->{$_}) . ";\n"; } (@{$cluster_nodes{$cluster}}); + $dot .= $clusters_edge{$cluster} if exists $clusters_edge{$cluster}; + $dot .= "\t}\n"; + } + + # Deal with ranks + my %ranks; + foreach my $name (@nodelist) { + my $node = $self->{NODES}->{$name}; + next unless exists $node->{rank}; + push @{$ranks{$node->{rank}}}, $name; + } + + foreach my $rank (keys %ranks) { + $dot .= qq|\t{rank=same; |; + $dot .= join '; ', map { $self->_quote_name($_) } @{$ranks{$rank}}; + $dot .= qq|}\n|; + } +# {rank=same; Paris; Boston} + + + $dot .= "}\n"; + + + if($self->{UNFLATTEN}) { + my $flatdot; + run ['unflatten'], \$dot, \$flatdot; + return $flatdot + } else { + return $dot; + } +} + + +# Call dot / neato / twopi / circo / fdp with the input text and any parameters + +sub _as_generic { + my($self, $type, $dot, $output) = @_; + + my $buffer; + my $out; + if ( ref $output || UNIVERSAL::isa(\$output, 'GLOB') ) { + # $output is a filehandle or a scalar reference or something. + # have to take a reference to a bare filehandle or run will + # complain + $out = ref $output ? $output : \$output; + } elsif (defined $output) { + # if it's defined it must be a filename so we'll write to it. + $out = $output; + } else { + # but otherwise we capture output in a scalar + $out = \$buffer; + } + + my $program = $self->{LAYOUT}; + + run [$program, $type], \$dot, ">", binary(), $out; + + return $buffer unless defined $output; +} + + +# Quote a node/edge name using dot / neato / circo / fdp / twopi's quoting rules + +sub _quote_name { + my($self, $name) = @_; + my $realname = $name; + + return $self->{_QUOTE_NAME_CACHE}->{$name} if $name && exists $self->{_QUOTE_NAME_CACHE}->{$name}; + + if (defined $name && $name =~ /^[a-zA-Z]\w*$/ && $name ne "graph") { + # name is fine + } elsif (defined $name && $name =~ /^[a-zA-Z](\w| )*$/) { + # name contains spaces, so quote it + $name = '"' . $name . '"'; + } else { + # name contains weird characters - let's make up a name for it + $name = 'node' . ++$self->{_NAME_COUNTER}; + } + + $self->{_QUOTE_NAME_CACHE}->{$realname} = $name if defined $realname; + +# warn "# $realname -> $name\n"; + + return $name; +} + + +# Return the attributes of a node or edge as a dot / neato / circo / fdp / twopi attribute +# string + +sub _attributes { + my $thing = shift; + + my @attributes; + + foreach my $key (keys %$thing) { + next if $key =~ /^_/; + next if $key =~ /^(to|from|name|cluster|from_port|to_port)$/; + + my $value = $thing->{$key}; + $value =~ s|"|\"|g; + $value = '"' . $value . '"' unless ($key eq 'label' && $value =~ /^<FE + +=head1 COPYRIGHT + +Copyright (C) 2000-4, Leon Brocard + +This module is free software; you can redistribute it or modify it +under the same terms as Perl itself. + +=cut + +1; Modified: Tools/RCTaskViz/RCTaskViz.pl =================================================================== --- Tools/RCTaskViz/RCTaskViz.pl 2007-04-18 04:13:05 UTC (rev 23) +++ Tools/RCTaskViz/RCTaskViz.pl 2007-04-19 17:26:04 UTC (rev 24) @@ -5,15 +5,21 @@ use GraphViz; use Getopt::Std; +use File::Spec; my %options=(); -getopts('g',\%options); -die "usage: $0 -g {dialog task filename}$/" if !@ARGV; +getopts('gl:',\%options); +die "usage: $0 -g -l