--- mh/lib/Voice_Text.pm	Sun Apr  9 13:03:20 2000
+++ mh-kees/lib/Voice_Text.pm	Thu May  4 17:47:06 2000
@@ -2,7 +2,8 @@
 package Voice_Text;
 use strict;
 
-my ($VTxt, $VTxt_festival, $VTxt_Outloud, $save_mute_esd, $save_change_volume);
+my ($VTxt, $VTxt_festival, $VTxt_Outloud, $save_mute_esd, $save_change_volume,
+    %pronouncable);
 
 sub init {
 
@@ -11,6 +12,10 @@
 		my $festival_address = "$main::config_parms{festival_host}:$main::config_parms{festival_port}";
 		$VTxt_festival = new  Socket_Item(undef, undef, $festival_address);
 		start $VTxt_festival;
+		if ($main::config_parms{festival_init_cmds}) {
+        		   print "Data sent to festival: $main::config_parms{festival_init_cmds}\n";
+			   set $VTxt_festival qq[$main::config_parms{festival_init_cmds}];
+		}
 	}
 	if ($main::config_parms{voice_text} =~ /vvo_speak/i) {
 		print "Creating ViaVoice Outloud socket\n";
@@ -50,6 +55,8 @@
         	return;
 	}
 
+	$parms{text} = force_pronounce($parms{text});
+
 	if ($VTxt_festival) {
 #<SABLE>
 #<SPEAKER NAME="male1">
@@ -164,6 +171,40 @@
     set $VTxt_Outloud $command;
     set $VTxt_Outloud $setting;
     return;
+}
+
+sub read_pronouncable_list {
+    my($pronouncable_list_file) = @_;
+
+    my ($phonemes, $word, $cnt);
+
+    open (WORDS, $pronouncable_list_file) or print "\nError, could not find the pronouncable word file $pronouncable_list_file: $!\n"; 
+
+    undef %pronouncable;
+    while (<WORDS>) {
+        next if /^\#/;
+        ($word, $phonemes) = $_ =~ /^(\S+)\s+(.+)\s*$/;
+        next unless $word;
+        $cnt++;
+        $pronouncable{$word} = $phonemes;
+    }
+    print "Read in $cnt pronouncable entries from $pronouncable_list_file\n";
+    close WORDS;
+}
+
+sub force_pronounce {
+        my($phrase)=@_;
+
+	#print "input phrase is '$phrase'\n";
+
+        my($word,$phonemes);
+
+        foreach $word (keys %pronouncable) {
+                $phrase=~s/\b$word\b/$pronouncable{$word}/gi;
+        }
+
+	#print "output phrase is '$phrase'\n";
+        $phrase;
 }
     
 1;
--- mh/bin/mh	Sun Apr  9 13:41:16 2000
+++ mh-kees/bin/mh	Thu May  4 17:41:40 2000
@@ -2380,6 +2380,8 @@
 
         &Caller_ID::read_callerid_list($config_parms{caller_id_file}) 
             if file_change($config_parms{caller_id_file}) or $Startup;
+        &Voice_Text::read_pronouncable_list($config_parms{pronouncable_list_file}) 
+            if file_change($config_parms{pronouncable_list_file}) or $Startup;
     }
     # Save object states every 5 minutes, in case mh is aborted without a proper shutdown
     &object_states_save if $New_Minute and !($Minute % 5);
--- mh/bin/mh.ini	Thu May  4 17:49:36 2000
+++ mh-kees/bin/mh.ini	Thu May  4 17:52:00 2000
@@ -297,6 +297,8 @@
 #
 #    - viavoice_off_phrase:     Command{s} used to turn the viavoice microphone off.
 #
+#    - pronouncable_list_file:	List of words to forcibly pronounce
+#
 #---
 voice_cmd=viavoice              # Voice recognition
 voice_text=festival             # Voice synthesis
@@ -326,6 +328,9 @@
 vvo_level=0 
 vvo_verbose=1 
 vvo_mute_esd=1 
+
+# reprounced words for TTS
+pronouncable_list_file=$Pgm_Root/data/pronouncable_words.list
 
 
 #---
--- mh/data/pronouncable_words.list	Thu May  4 17:54:28 2000
+++ mh-kees/data/pronouncable_words.list	Thu May  4 17:53:04 2000
@@ -0,0 +1,5 @@
+# List any words that your TTS software gets wrong here
+#
+# two columns:
+# WORD	HOW THE tts SHOULD SPEAK IT
+Kees	Cayss
