Re: [orca-list] Orca and pronunciation again!



OK - I checked in a new patch to both trunk and gnome-2-24.  Please try
it out (you don't need to apply a patch - just update your svn area) and
let me know if it works.  Better yet, add a comment to
http://bugzilla.gnome.org/show_bug.cgi?id=562060.

Hope this helps,

Will

On Wed, 2009-01-21 at 19:10 -0500, Willie Walker wrote:
Actually, I think it might indeed be the patch to bug #562020.

One of the changes it made was to push the pronunciation adjustment from
gnomespeechfactory.py to speech.py.  The impact of this is that
gnomespeechfactory.py's speakCharacter no longer results in the
pronunciation adjustment from happening.

I'll see if I can come up with a patch that is copacetic with
gnomespeechfactory and speechdispatcherfactory.

Will

On Wed, 2009-01-21 at 16:42 -0500, Willie Walker wrote:
Hmmm....it might be bug #562060.  Attached is a patch to revert most of 
that change.  Can you try this out to see if it makes your problem go away?

Will

VÃtor Oliveira wrote:
Hi Will: take an example: portuguese voxin voice, when there is an e, it 
reads i. So, we need to replace the e character for Ã. So, when in 
preferences dialog, we must ask for pronuntiation tab, and add a new 
entree. All works fine. We aply and exit. When we write, it wil be 
expected to hear à and not i. Also, if we moov the cursor, it should be 
the same. But what we can hear is an i, not Ã. But, during say all, it 
works fine. Until the last update, all was working fine. Best regards.

Victor Oliveira   

Em 21-01-2009 20:12, Willie Walker escreveu:
Hi VÃtor:

Hmm...seems to work for me. I'm taking it that you are are Ubuntu
Intrepid with the latest Orca from SVN trunk. If so, I think I need more
information from you. :-(

Can you provide me with an exact set of steps that succinctly show the
problem? For example, exact text you entered in gedit, the exact
keystrokes you're using to review the text, what orca is saying, and
what you expect it to say?

Thanks!

Will

VÃtor Oliveira wrote:
Hi Will, I'm addressing the message to you for not disturb the list
about my problems: About the question, the fact is all was working
fine until this last update. We hav a portuguese language net in a
list called linvox. Everybody is having the same problem, I'm not the
only one! But there it goes in attachment my settings: Best regards.

Victor Oliveira


Em 21-01-2009 18:38, Willie Walker escreveu:
Hi VÃtor:

I just checked with Orca from SVN trunk on my OpenSolaris 2008.11
machine and it works fine. Can you enable debugging
(http://live.gnome.org/Orca/Debugging) and try to get a log of a run
where the pronunciation functionality is not working for you? Please
also attach your user-settings.py file.

Will

VÃtor Oliveira wrote:
Wel, as I couldn't get any kind of answer about this question, here I
am again

Sinse the last update on Munday orca doesn't recognize correctly any
modification writen in pronunciation tab in preferences.

t's particularly dificult in some voices, as voxin for example,
because it's necessary to introduce modifications to make it work
correctly. 'm using ubuntu intrepid with the last svn update. Best
regards.

Victor Oliveira
!
_______________________________________________
Orca-list mailing list
Orca-list gnome org
http://mail.gnome.org/mailman/listinfo/orca-list
Visit http://live.gnome.org/Orca for more information on Orca




_______________________________________________
Orca-list mailing list
Orca-list gnome org
http://mail.gnome.org/mailman/listinfo/orca-list
Visit http://live.gnome.org/Orca for more information on Orca

plain text document attachment (revert-562060)
Index: src/orca/settings.py
===================================================================
--- src/orca/settings.py    (revision 4449)
+++ src/orca/settings.py    (working copy)
@@ -162,7 +162,6 @@
     "sayAllStyle",
     "keyboardLayout",
     "speakBlankLines",
-    "speakMultiCaseStringsAsWords",
     "enabledSpokenTextAttributes",
     "enabledBrailledTextAttributes",
     "textAttributesBrailleIndicator",
@@ -630,10 +629,6 @@
 #
 speakBlankLines         = True
 
-# if True, process multi case strings as words.
-#
-speakMultiCaseStringsAsWords = False
-
 # If True, reads all the table cells in the current row rather than just
 # the current one.
 #
Index: src/orca/speechdispatcherfactory.py
===================================================================
--- src/orca/speechdispatcherfactory.py     (revision 4449)
+++ src/orca/speechdispatcherfactory.py     (working copy)
@@ -44,6 +44,7 @@
 import speechserver
 import settings
 import orca
+import orca_state
 from acss import ACSS
 from orca_i18n import _
 
@@ -326,7 +327,8 @@
     def speak(self, text=None, acss=None, interrupt=True):
         #if interrupt:
         #    self._cancel()
-
+        if orca_state.activeScript and orca_state.usePronunciationDictionary:
+            text = orca_state.activeScript.adjustForPronunciation(text)
         if text:
             self._speak(text, acss)
 
Index: src/orca/speech.py
===================================================================
--- src/orca/speech.py      (revision 4449)
+++ src/orca/speech.py      (working copy)
@@ -29,7 +29,6 @@
 import logging
 log = logging.getLogger("speech")
 
-import re
 import time
 
 import chnames
@@ -46,13 +45,6 @@
 #
 _speechserver = None
 
-# regular expressions for multiCaseStrings
-#
-multiCaseReg1 = re.compile("([a-z]+)([A-Z][a-z]+)")
-multiCaseReg2 = re.compile("([a-z]+)([A-Z]+)")
-multiCaseReg3 = re.compile("([A-Z]{2}[A-Z]+)([a-z]+)")
-multiCaseReg4 = re.compile("([A-Z])([A-Z][a-z]+)")
-
 def getSpeechServerFactories():
     """Imports all known SpeechServer factory modules.  Returns a list
     of modules that implement the getSpeechServers method, which
@@ -162,13 +154,6 @@
     if settings.silenceSpeech:
         return
 
-    if settings.speakMultiCaseStringsAsWords:
-        text = _processMultiCaseString(text)
-    if orca_state.activeScript and orca_state.usePronunciationDictionary:
-        text = orca_state.activeScript.adjustForPronunciation(text)
-    if settings.speakMultiCaseStringsAsWords:
-        text = _processMultiCaseString(text)
-
     logLine = "SPEECH OUTPUT: '" + text + "'"
     debug.println(debug.LEVEL_INFO, logLine)
     log.info(logLine)
@@ -260,19 +245,8 @@
 
     if settings.silenceSpeech:
         return
-    i = 0
-    length = len(utterances)
-    while ( i < length ):
-        utterance = utterances[i]
-        if settings.speakMultiCaseStringsAsWords:
-            utterance = _processMultiCaseString(utterance)
-        if settings.speakMultiCaseStringsAsWords:
-            utterances[i] = _processMultiCaseString(utterance)
-            utterance = utterances[i] 
-        if settings.speakMultiCaseStringsAsWords:
-            utterance = _processMultiCaseString(utterance)
-        i = i + 1
-        
+
+    for utterance in utterances:
         logLine = "SPEECH OUTPUT: '" + utterance + "'"
         debug.println(debug.LEVEL_INFO, logLine)
         log.info(logLine)
@@ -371,14 +345,3 @@
                 server.shutdown()
             except:
                 debug.printException(debug.LEVEL_OFF)
-
-def _processMultiCaseString(string):
-    """Helper function, applies the regexes to split multiCaseStrings
-    to multiple words.
-    """
-
-    string = multiCaseReg1.sub('\\1 \\2', string)
-    string = multiCaseReg2.sub('\\1 \\2', string)
-    string = multiCaseReg3.sub('\\1 \\2', string)    
-    string = multiCaseReg4.sub('\\1 \\2', string)
-    return string
Index: src/orca/gnomespeechfactory.py
===================================================================
--- src/orca/gnomespeechfactory.py  (revision 4449)
+++ src/orca/gnomespeechfactory.py  (working copy)
@@ -894,6 +894,8 @@
             return -1
 
         text = self.__addVerbalizedPunctuation(text)
+        if orca_state.activeScript and orca_state.usePronunciationDictionary:
+            text = orca_state.activeScript.adjustForPronunciation(text)
 
         try:
             # [[[TODO: WDW - back this stop out for now.  The problem is
Index: src/orca/orca_gui_prefs.py
===================================================================
--- src/orca/orca_gui_prefs.py      (revision 4449)
+++ src/orca/orca_gui_prefs.py      (working copy)
@@ -1485,8 +1485,6 @@
 
         self.get_widget("speakBlankLinesCheckButton").set_active(\
             prefs["speakBlankLines"])
-        self.get_widget("speakMultiCaseAsWordsCheckButton").set_active(\
-            prefs["speakMultiCaseStringsAsWords"])
         self.get_widget("speakTutorialMessagesCheckButton").set_active(\
             prefs["enableTutorialMessages"])
 
@@ -2480,18 +2478,6 @@
 
         self.prefsDict["speakBlankLines"] = widget.get_active()
 
-    def speakMultiCaseStringsToggled(self, widget):
-        """Signal handler for the "toggled" signal for the
-           speakMultiCaseAsWordsCheckButton GtkCheckButton widget. The user has
-           [un]checked the checkbox.
-           Set the 'speakMultiCaseStringsAsWords' preference to the new value.
-
-        Arguments:
-        - widget: the component that generated the signal.
-        """
-
-        self.prefsDict["speakMultiCaseStringsAsWords"] = widget.get_active()
-
     def speakTutorialMessagesToggled(self, widget):
         """Signal handler for the "toggled" signal for the
            speakTutorialMessagesCheckButton GtkCheckButton widget.
_______________________________________________
Orca-list mailing list
Orca-list gnome org
http://mail.gnome.org/mailman/listinfo/orca-list
Visit http://live.gnome.org/Orca for more information on Orca

_______________________________________________
Orca-list mailing list
Orca-list gnome org
http://mail.gnome.org/mailman/listinfo/orca-list
Visit http://live.gnome.org/Orca for more information on Orca




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]