[orca] Break text blocks into sentence chunks when doing SayAll by Sentence in Gecko



commit bade7ac11d5126c91d2d682e95aed68638067246
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sun Jan 18 16:29:34 2015 -0500

    Break text blocks into sentence chunks when doing SayAll by Sentence in Gecko
    
    This should improve the accuracy of setting the location when SayAll is
    interrupted in large elements consisting only of text, at least getting
    us closer to the sentence being presented. It also eliminates some double-
    presenting of content during SayAll.

 src/orca/scripts/toolkits/Gecko/script.py          |   32 +------
 .../scripts/toolkits/Gecko/script_utilities.py     |   72 +++++++++++++-
 test/keystrokes/firefox/say_all_blockquote.py      |   28 +++++-
 test/keystrokes/firefox/say_all_bug_591351_1.py    |   11 ++-
 test/keystrokes/firefox/say_all_bugzilla_search.py |   16 +---
 test/keystrokes/firefox/say_all_empty_anchor.py    |   18 ++-
 test/keystrokes/firefox/say_all_enter_bug.py       |    6 +-
 test/keystrokes/firefox/say_all_entries.py         |   11 +--
 test/keystrokes/firefox/say_all_imagemap.py        |    4 +-
 test/keystrokes/firefox/say_all_role_lists.py      |    3 +-
 test/keystrokes/firefox/say_all_wiki.py            |  108 ++++++--------------
 11 files changed, 159 insertions(+), 150 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/Gecko/script.py b/src/orca/scripts/toolkits/Gecko/script.py
index 17f53c1..f58b7b2 100644
--- a/src/orca/scripts/toolkits/Gecko/script.py
+++ b/src/orca/scripts/toolkits/Gecko/script.py
@@ -721,44 +721,14 @@ class Script(default.Script):
         spoken and acss is an ACSS instance for speaking the text.
         """
 
-        # Determine the correct "say all by" mode to use.
-        #
         sayAllStyle = _settingsManager.getSetting('sayAllStyle')
         sayAllBySentence = sayAllStyle == settings.SAYALL_STYLE_SENTENCE
-
         [obj, characterOffset] = self.getCaretContext()
-        if sayAllBySentence:
-            # Attempt to locate the start of the current sentence by
-            # searching to the left for a sentence terminator.  If we don't
-            # find one, or if the "say all by" mode is not sentence, we'll
-            # just start the sayAll from at the beginning of this line/object.
-            #
-            text = self.utilities.queryNonEmptyText(obj)
-            if text:
-                [line, startOffset, endOffset] = \
-                    text.getTextAtOffset(characterOffset,
-                                         pyatspi.TEXT_BOUNDARY_LINE_START)
-                beginAt = 0
-                if line.strip():
-                    terminators = ['. ', '? ', '! ']
-                    for terminator in terminators:
-                        try:
-                            index = line.rindex(terminator,
-                                                0,
-                                                characterOffset - startOffset)
-                            if index > beginAt:
-                                beginAt = index
-                        except:
-                            pass
-                    characterOffset = startOffset + beginAt
-                else:
-                    [obj, characterOffset] = \
-                        self.findNextCaretInOrder(obj, characterOffset)
 
         done = False
         while not done:
             if sayAllBySentence:
-                contents = self.getObjectContentsAtOffset(obj, characterOffset)
+                contents = self.utilities.getSentenceContentsAtOffset(obj, characterOffset)
             else:
                 contents = self.getLineContentsAtOffset(obj, characterOffset)
             for content in contents:
diff --git a/src/orca/scripts/toolkits/Gecko/script_utilities.py 
b/src/orca/scripts/toolkits/Gecko/script_utilities.py
index daa6f06..64297a7 100644
--- a/src/orca/scripts/toolkits/Gecko/script_utilities.py
+++ b/src/orca/scripts/toolkits/Gecko/script_utilities.py
@@ -544,6 +544,9 @@ class Utilities(script_utilities.Utilities):
         allText = text.getText(0, -1)
         extents = list(text.getRangeExtents(offset, offset + 1, 0))
 
+        def _inThisSentence(span):
+            return span[0] <= offset <= span[1]
+
         def _inThisWord(span):
             return span[0] <= offset <= span[1]
 
@@ -552,10 +555,14 @@ class Utilities(script_utilities.Utilities):
             return self.extentsAreOnSameLine(extents, rangeExtents)
 
         words = [m.span() for m in re.finditer("[^\s\ufffc]+", allText)]
+        sentences = [m.span() for m in re.finditer("\S[^\.\?\!]+((?<!\w)[\.\?\!]+(?!\w)|\S*)", allText)]
         if boundary == pyatspi.TEXT_BOUNDARY_LINE_START:
             segments = list(filter(_onThisLine, words))
         elif boundary == pyatspi.TEXT_BOUNDARY_WORD_START:
             segments = list(filter(_inThisWord, words))
+        elif boundary == pyatspi.TEXT_BOUNDARY_SENTENCE_START:
+            sentences = sentences or [(0, text.characterCount)]
+            segments = list(filter(_inThisSentence, sentences))
         else:
             return '', 0, 0
 
@@ -576,7 +583,13 @@ class Utilities(script_utilities.Utilities):
         if not text:
             return '', 0, 1
 
-        if self._treatTextObjectAsWhole(obj):
+        treatAsWhole = self._treatTextObjectAsWhole(obj)
+        if not treatAsWhole and boundary == pyatspi.TEXT_BOUNDARY_SENTENCE_START:
+            if obj.getRole() in [pyatspi.ROLE_LIST_ITEM, pyatspi.ROLE_HEADING] \
+               or not self.isTextBlockElement(obj):
+                treatAsWhole = True
+
+        if treatAsWhole:
             return text.getText(0, -1), 0, text.characterCount
 
         offset = max(0, offset)
@@ -658,6 +671,61 @@ class Utilities(script_utilities.Utilities):
 
         return [[obj, start, end, string]]
 
+    def getSentenceContentsAtOffset(self, obj, offset):
+        if not obj:
+            return []
+
+        boundary = pyatspi.TEXT_BOUNDARY_SENTENCE_START
+        objects = self._getContentsForObj(obj, offset, boundary)
+
+        def _treatAsSentenceEnd(x):
+            xObj, xStart, xEnd, xString = x
+            if not self.isTextBlockElement(xObj):
+                return False
+
+            text = self.queryNonEmptyText(xObj)
+            if text and 0 < text.characterCount <= xEnd:
+                return True
+
+            if 0 <= xStart <= 5:
+                xString = " ".join(xString.split()[1:])
+
+            match = re.search("\S[\.\!\?]+(\s|\Z)", xString)
+            return match != None
+
+        # Check for things in the same sentence before this object.
+        firstObj, firstStart, firstEnd, firstString = objects[0]
+        while firstObj and firstString:
+            if firstStart == 0 and self.isTextBlockElement(firstObj):
+                break
+
+            prevObj, pOffset = self._script.findPreviousCaretInOrder(firstObj, firstStart)
+            onLeft = self._getContentsForObj(prevObj, pOffset, boundary)
+            onLeft = list(filter(lambda x: x not in objects, onLeft))
+            endsOnLeft = list(filter(_treatAsSentenceEnd, onLeft))
+            if endsOnLeft:
+                i = onLeft.index(endsOnLeft[-1])
+                onLeft = onLeft[i+1:]
+
+            if not onLeft:
+                break
+
+            objects[0:0] = onLeft
+            firstObj, firstStart, firstEnd, firstString = objects[0]
+
+        # Check for things in the same sentence after this object.
+        while not _treatAsSentenceEnd(objects[-1]):
+            lastObj, lastStart, lastEnd, lastString = objects[-1]
+            nextObj, nOffset = self._script.findNextCaretInOrder(lastObj, lastEnd - 1)
+            onRight = self._getContentsForObj(nextObj, nOffset, boundary)
+            onRight = list(filter(lambda x: x not in objects, onRight))
+            if not onRight:
+                break
+
+            objects.extend(onRight)
+
+        return objects
+
     def getWordContentsAtOffset(self, obj, offset):
         if not obj:
             return []
@@ -843,7 +911,7 @@ class Utilities(script_utilities.Utilities):
         return False
 
     def isTextBlockElement(self, obj):
-        if not self._script.inDocumentContent(obj):
+        if not (obj and self._script.inDocumentContent(obj)):
             return False
 
         textBlockElements = [pyatspi.ROLE_COLUMN_HEADER,
diff --git a/test/keystrokes/firefox/say_all_blockquote.py b/test/keystrokes/firefox/say_all_blockquote.py
index d6e749c..bb02e39 100644
--- a/test/keystrokes/firefox/say_all_blockquote.py
+++ b/test/keystrokes/firefox/say_all_blockquote.py
@@ -12,11 +12,33 @@ sequence.append(KeyComboAction("KP_Add"))
 sequence.append(utils.AssertPresentationAction(
     "1. KP_Add to do a SayAll",
     ["SPEECH OUTPUT: 'On weaponry:'",
-     "SPEECH OUTPUT: 'NOBODY expects the Spanish Inquisition! Our chief weapon is surprise. Surprise and 
fear. Fear and surprise. Our two weapons are fear and surprise. And ruthless efficiency. Our three weapons 
are fear, surprise, and ruthless efficiency. And an almost fanatical devotion to the Pope. Our four. No. 
Amongst our weapons. Amongst our weaponry, are such elements as fear, surprise. I'll come in again. NOBODY 
expects the Spanish Inquisition! Amongst our weaponry are such diverse elements as: fear, surprise, ruthless 
efficiency, an almost fanatical devotion to the Pope, and nice red uniforms - Oh damn!'",
+     "SPEECH OUTPUT: 'NOBODY expects the Spanish Inquisition!'",
+     "SPEECH OUTPUT: 'Our chief weapon is surprise.'",
+     "SPEECH OUTPUT: 'Surprise and fear.'",
+     "SPEECH OUTPUT: 'Fear and surprise.'",
+     "SPEECH OUTPUT: 'Our two weapons are fear and surprise.'",
+     "SPEECH OUTPUT: 'And ruthless efficiency.'",
+     "SPEECH OUTPUT: 'Our three weapons are fear, surprise, and ruthless efficiency.'",
+     "SPEECH OUTPUT: 'And an almost fanatical devotion to the Pope.'",
+     "SPEECH OUTPUT: 'Our four.'",
+     "SPEECH OUTPUT: 'No.'",
+     "SPEECH OUTPUT: 'Amongst our weapons.'",
+     "SPEECH OUTPUT: 'Amongst our weaponry, are such elements as fear, surprise.'",
+     "SPEECH OUTPUT: 'I'll come in again.'",
+     "SPEECH OUTPUT: 'NOBODY expects the Spanish Inquisition!'",
+     "SPEECH OUTPUT: 'Amongst our weaponry are such diverse elements as: fear, surprise, ruthless 
efficiency, an almost fanatical devotion to the Pope, and nice red uniforms - Oh damn!'",
      "SPEECH OUTPUT: 'On old ladies:'",
-     "SPEECH OUTPUT: 'Now old lady, you have one last chance. Confess the heinous sin of heresy, reject the 
works of the ungodly. Two last chances. And you shall be free. Three last chances. You have three last 
chances, the nature of which I have divulged in my previous utterance.'",
+     "SPEECH OUTPUT: 'Now old lady, you have one last chance.'",
+     "SPEECH OUTPUT: 'Confess the heinous sin of heresy, reject the works of the ungodly.'",
+     "SPEECH OUTPUT: 'Two last chances.'",
+     "SPEECH OUTPUT: 'And you shall be free.'",
+     "SPEECH OUTPUT: 'Three last chances.'",
+     "SPEECH OUTPUT: 'You have three last chances, the nature of which I have divulged in my previous 
utterance.'",
      "SPEECH OUTPUT: 'On castle decor:'",
-     "SPEECH OUTPUT: 'Hm! She is made of harder stuff! Cardinal Fang! Fetch the COMFY CHAIR!'"]))
+     "SPEECH OUTPUT: 'Hm!'",
+     "SPEECH OUTPUT: 'She is made of harder stuff!'",
+     "SPEECH OUTPUT: 'Cardinal Fang!'",
+     "SPEECH OUTPUT: 'Fetch the COMFY CHAIR!'"]))
 
 sequence.append(utils.AssertionSummaryAction())
 sequence.start()
diff --git a/test/keystrokes/firefox/say_all_bug_591351_1.py b/test/keystrokes/firefox/say_all_bug_591351_1.py
index edc9079..4b84066 100644
--- a/test/keystrokes/firefox/say_all_bug_591351_1.py
+++ b/test/keystrokes/firefox/say_all_bug_591351_1.py
@@ -12,11 +12,16 @@ sequence.append(KeyComboAction("KP_Add"))
 sequence.append(utils.AssertPresentationAction(
     "1. KP_Add to do a SayAll",
     ["SPEECH OUTPUT: 'Hello world.'",
-     "SPEECH OUTPUT: 'I wonder what a bevezeto is. I should Google that.'",
-     "SPEECH OUTPUT: 'Aha! It is the Hungarian word for \"Introduction\". Here is some'",
+     "SPEECH OUTPUT: 'I wonder what a bevezeto is.'",
+     "SPEECH OUTPUT: 'I should Google that.'",
+     "SPEECH OUTPUT: 'Aha!'",
+     "SPEECH OUTPUT: 'It is the Hungarian word for \"Introduction\".'",
+     "SPEECH OUTPUT: 'Here is some'",
      "SPEECH OUTPUT: 'proof'",
      "SPEECH OUTPUT: 'link'",
-     "SPEECH OUTPUT: '. I really think we need to get Attila to teach the Orca team some Hungarian. Maybe 
one (really easy) phrase per bug comment.'",
+     "SPEECH OUTPUT: '.'",
+     "SPEECH OUTPUT: 'I really think we need to get Attila to teach the Orca team some Hungarian.'",
+     "SPEECH OUTPUT: 'Maybe one (really easy) phrase per bug comment.'",
      "SPEECH OUTPUT: 'separator'",
      "SPEECH OUTPUT: 'Foo'",
      "SPEECH OUTPUT: 'link'"]))
diff --git a/test/keystrokes/firefox/say_all_bugzilla_search.py 
b/test/keystrokes/firefox/say_all_bugzilla_search.py
index b1493ef..558495d 100644
--- a/test/keystrokes/firefox/say_all_bugzilla_search.py
+++ b/test/keystrokes/firefox/say_all_bugzilla_search.py
@@ -39,7 +39,8 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: '·'",
      "SPEECH OUTPUT: 'Help'",
      "SPEECH OUTPUT: 'link'",
-     "SPEECH OUTPUT: 'Logged In joanmarie diggs gmail com |'",
+     "SPEECH OUTPUT: 'Logged In joanmarie diggs gmail com'",
+     "SPEECH OUTPUT: '|'",
      "SPEECH OUTPUT: 'Log Out'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'Short Bug Search Form'",
@@ -152,23 +153,18 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'the bug assignee'",
      "SPEECH OUTPUT: 'check box'",
      "SPEECH OUTPUT: 'checked'",
-     "SPEECH OUTPUT: 'the bug assignee'",
      "SPEECH OUTPUT: 'the reporter'",
      "SPEECH OUTPUT: 'check box'",
      "SPEECH OUTPUT: 'not checked'",
-     "SPEECH OUTPUT: 'the reporter'",
      "SPEECH OUTPUT: 'the QA contact'",
      "SPEECH OUTPUT: 'check box'",
      "SPEECH OUTPUT: 'not checked'",
-     "SPEECH OUTPUT: 'the QA contact'",
      "SPEECH OUTPUT: 'a CC list member'",
      "SPEECH OUTPUT: 'check box'",
      "SPEECH OUTPUT: 'not checked'",
-     "SPEECH OUTPUT: 'a CC list member'",
      "SPEECH OUTPUT: 'a commenter'",
      "SPEECH OUTPUT: 'check box'",
      "SPEECH OUTPUT: 'not checked'",
-     "SPEECH OUTPUT: 'a commenter'",
      "SPEECH OUTPUT: 'contains'",
      "SPEECH OUTPUT: 'combo box'",
      "SPEECH OUTPUT: 'entry'",
@@ -177,23 +173,18 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'the bug assignee'",
      "SPEECH OUTPUT: 'check box'",
      "SPEECH OUTPUT: 'checked'",
-     "SPEECH OUTPUT: 'the bug assignee'",
      "SPEECH OUTPUT: 'the reporter'",
      "SPEECH OUTPUT: 'check box'",
      "SPEECH OUTPUT: 'checked'",
-     "SPEECH OUTPUT: 'the reporter'",
      "SPEECH OUTPUT: 'the QA contact'",
      "SPEECH OUTPUT: 'check box'",
      "SPEECH OUTPUT: 'checked'",
-     "SPEECH OUTPUT: 'the QA contact'",
      "SPEECH OUTPUT: 'a CC list member'",
      "SPEECH OUTPUT: 'check box'",
      "SPEECH OUTPUT: 'checked'",
-     "SPEECH OUTPUT: 'a CC list member'",
      "SPEECH OUTPUT: 'a commenter'",
      "SPEECH OUTPUT: 'check box'",
      "SPEECH OUTPUT: 'not checked'",
-     "SPEECH OUTPUT: 'a commenter'",
      "SPEECH OUTPUT: 'contains'",
      "SPEECH OUTPUT: 'combo box'",
      "SPEECH OUTPUT: 'entry'",
@@ -205,7 +196,6 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: '(comma-separated list)'",
      "SPEECH OUTPUT: 'entry'",
      "SPEECH OUTPUT: ''",
-     "SPEECH OUTPUT: '(comma-separated list)'",
      "SPEECH OUTPUT: 'Bug Changes'",
      "SPEECH OUTPUT: 'Only bugs changed between:'",
      "SPEECH OUTPUT: '(YYYY-MM-DD or relative dates)'",
@@ -214,7 +204,6 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'and'",
      "SPEECH OUTPUT: 'entry'",
      "SPEECH OUTPUT: 'Now'",
-     "SPEECH OUTPUT: '(YYYY-MM-DD or relative dates)'",
      "SPEECH OUTPUT: 'where one or more of the following changed:'",
      "SPEECH OUTPUT: '[Bug creation]'",
      "SPEECH OUTPUT: 'multi-select'",
@@ -247,7 +236,6 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'Not (negate this whole chart)'",
      "SPEECH OUTPUT: 'check box'",
      "SPEECH OUTPUT: 'not checked'",
-     "SPEECH OUTPUT: 'Not (negate this whole chart)'",
      "SPEECH OUTPUT: '---'",
      "SPEECH OUTPUT: 'combo box'",
      "SPEECH OUTPUT: '---'",
diff --git a/test/keystrokes/firefox/say_all_empty_anchor.py b/test/keystrokes/firefox/say_all_empty_anchor.py
index 8d977b8..ee6b8e7 100644
--- a/test/keystrokes/firefox/say_all_empty_anchor.py
+++ b/test/keystrokes/firefox/say_all_empty_anchor.py
@@ -29,12 +29,18 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'Battery'",
      "SPEECH OUTPUT: 'heading level 2'",
-     "SPEECH OUTPUT: 'Q. What is a battery?",
-     "A. Look it up.'",
-     "SPEECH OUTPUT: 'Q. Which way is up?",
-     "A. That way.'",
-     "SPEECH OUTPUT: 'Q. Why did Orca used to get stuck on this page?",
-     "A. Empty anchors.'"]))
+     "SPEECH OUTPUT: 'Q.'",
+     "SPEECH OUTPUT: 'What is a battery?'",
+     "SPEECH OUTPUT: 'A'",
+     "SPEECH OUTPUT: '. Look it up.'",
+     "SPEECH OUTPUT: 'Q.'",
+     "SPEECH OUTPUT: 'Which way is up?'",
+     "SPEECH OUTPUT: 'A'",
+     "SPEECH OUTPUT: '. That way.'",
+     "SPEECH OUTPUT: 'Q.'",
+     "SPEECH OUTPUT: 'Why did Orca used to get stuck on this page?'",
+     "SPEECH OUTPUT: 'A'",
+     "SPEECH OUTPUT: '. Empty anchors.'"]))
 
 sequence.append(utils.AssertionSummaryAction())
 sequence.start()
diff --git a/test/keystrokes/firefox/say_all_enter_bug.py b/test/keystrokes/firefox/say_all_enter_bug.py
index 4eb2f5a..c9dac75 100644
--- a/test/keystrokes/firefox/say_all_enter_bug.py
+++ b/test/keystrokes/firefox/say_all_enter_bug.py
@@ -35,7 +35,8 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: '·'",
      "SPEECH OUTPUT: 'Help'",
      "SPEECH OUTPUT: 'link'",
-     "SPEECH OUTPUT: 'Logged In joanmarie diggs gmail com |'",
+     "SPEECH OUTPUT: 'Logged In joanmarie diggs gmail com'",
+     "SPEECH OUTPUT: '|'",
      "SPEECH OUTPUT: 'Log Out'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'Enter Bug: orca \u2013 This page lets you enter a new bug into Bugzilla.'",
@@ -116,7 +117,8 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'push button'",
      "SPEECH OUTPUT: 'Remember values as bookmarkable template'",
      "SPEECH OUTPUT: 'push button'",
-     "SPEECH OUTPUT: 'We've made a guess at your operating system. Please check it and, if we got it wrong, 
email bugmaster gnome org '",
+     "SPEECH OUTPUT: 'We've made a guess at your operating system.'",
+     "SPEECH OUTPUT: 'Please check it and, if we got it wrong, email bugmaster gnome org '",
      "SPEECH OUTPUT: 'Saved Searches:'",
      "SPEECH OUTPUT: 'All Orca'",
      "SPEECH OUTPUT: 'link'",
diff --git a/test/keystrokes/firefox/say_all_entries.py b/test/keystrokes/firefox/say_all_entries.py
index 1574841..996e577 100644
--- a/test/keystrokes/firefox/say_all_entries.py
+++ b/test/keystrokes/firefox/say_all_entries.py
@@ -33,14 +33,13 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'I'm a label'",
      "SPEECH OUTPUT: 'entry'",
      "SPEECH OUTPUT: ''",
-     "SPEECH OUTPUT: 'I'm a label'",
      "SPEECH OUTPUT: 'Am I a label as well?'",
      "SPEECH OUTPUT: 'entry'",
      "SPEECH OUTPUT: ''",
-     "SPEECH OUTPUT: 'Am I a label as well?'",
      "SPEECH OUTPUT: 'What the heck should we do here?'",
      "SPEECH OUTPUT: 'heading level 2'",
-     "SPEECH OUTPUT: 'Looking at what follows visually, I'm not sure what I would type/i.e. what the labels 
are.'",
+     "SPEECH OUTPUT: 'Looking at what follows visually, I'm not sure what I would type/i.e.'",
+     "SPEECH OUTPUT: 'what the labels are.'",
      "SPEECH OUTPUT: 'Looking at what follows visually, I'm not sure what I would type/i.e. what the labels 
are.'",
      "SPEECH OUTPUT: 'entry'",
      "SPEECH OUTPUT: ''",
@@ -54,15 +53,12 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'First Name'",
      "SPEECH OUTPUT: 'entry'",
      "SPEECH OUTPUT: ''",
-     "SPEECH OUTPUT: 'First Name'",
      "SPEECH OUTPUT: 'M.I.'",
      "SPEECH OUTPUT: 'entry'",
      "SPEECH OUTPUT: ''",
-     "SPEECH OUTPUT: 'M.I.'",
      "SPEECH OUTPUT: 'Last Name'",
      "SPEECH OUTPUT: 'entry'",
      "SPEECH OUTPUT: ''",
-     "SPEECH OUTPUT: 'Last Name'",
      "SPEECH OUTPUT: 'Other times it's due to layout tables'",
      "SPEECH OUTPUT: 'heading level 2'",
      "SPEECH OUTPUT: 'First name'",
@@ -74,7 +70,6 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'Last name'",
      "SPEECH OUTPUT: 'entry'",
      "SPEECH OUTPUT: ''",
-     "SPEECH OUTPUT: 'First name'",
      "SPEECH OUTPUT: 'Middle",
      "initial'",
      "SPEECH OUTPUT: 'Last'",
@@ -112,7 +107,6 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'Surname'",
      "SPEECH OUTPUT: 'entry'",
      "SPEECH OUTPUT: ''",
-     "SPEECH OUTPUT: 'Given name'",
      "SPEECH OUTPUT: 'initial'",
      "SPEECH OUTPUT: 'Surname'",
      "SPEECH OUTPUT: 'First name'",
@@ -183,7 +177,6 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'bandaid graphic redux'",
      "SPEECH OUTPUT: 'entry'",
      "SPEECH OUTPUT: ''",
-     "SPEECH OUTPUT: 'bandaid graphic redux'",
      "SPEECH OUTPUT: 'Magic disappearing text trick:'",
      "SPEECH OUTPUT: 'entry'",
      "SPEECH OUTPUT: 'tab to me and I disappear'",
diff --git a/test/keystrokes/firefox/say_all_imagemap.py b/test/keystrokes/firefox/say_all_imagemap.py
index dba8663..b4a7da6 100644
--- a/test/keystrokes/firefox/say_all_imagemap.py
+++ b/test/keystrokes/firefox/say_all_imagemap.py
@@ -66,7 +66,9 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'a'",
      "SPEECH OUTPUT: 'image map link'",
      "SPEECH OUTPUT: 'Here is some text.'",
-     "SPEECH OUTPUT: 'Safeway had some interesting (and problematic) image maps. I didn't steal the images, 
but if you tab and look at the status bar, you should be able to see the URI for each region. We should also 
be speaking and brailling it correctly now -- at least as best as we can given what they gave us.'",
+     "SPEECH OUTPUT: 'Safeway had some interesting (and problematic) image maps.'",
+     "SPEECH OUTPUT: 'I didn't steal the images, but if you tab and look at the status bar, you should be 
able to see the URI for each region.'",
+     "SPEECH OUTPUT: 'We should also be speaking and brailling it correctly now -- at least as best as we 
can given what they gave us.'",
      "SPEECH OUTPUT: 'wk09_frozenmovie'",
      "SPEECH OUTPUT: 'image'",
      "SPEECH OUTPUT: 'link'",
diff --git a/test/keystrokes/firefox/say_all_role_lists.py b/test/keystrokes/firefox/say_all_role_lists.py
index 66ad2fe..58a3778 100644
--- a/test/keystrokes/firefox/say_all_role_lists.py
+++ b/test/keystrokes/firefox/say_all_role_lists.py
@@ -13,7 +13,8 @@ sequence.append(utils.AssertPresentationAction(
     "1. KP_Add to do a SayAll",
     ["SPEECH OUTPUT: 'Welcome to a List of Lists'",
      "SPEECH OUTPUT: 'heading level 1'",
-     "SPEECH OUTPUT: 'Lists are not only fun to make, they are fun to use. They help us:'",
+     "SPEECH OUTPUT: 'Lists are not only fun to make, they are fun to use.'",
+     "SPEECH OUTPUT: 'They help us:'",
      "SPEECH OUTPUT: '1. remember what the heck we are doing each day'",
      "SPEECH OUTPUT: '2. arrange long and arbitrary lines of text into ordered lists that are pleasing to 
the eye and suggest some sense of priority, even if it is artificial'",
      "SPEECH OUTPUT: '3. look really cool when we carry them around on yellow Post-Itstm.'",
diff --git a/test/keystrokes/firefox/say_all_wiki.py b/test/keystrokes/firefox/say_all_wiki.py
index 3b51152..2206676 100644
--- a/test/keystrokes/firefox/say_all_wiki.py
+++ b/test/keystrokes/firefox/say_all_wiki.py
@@ -60,16 +60,10 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'Accessible Applications'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: '|'",
-     "SPEECH OUTPUT: 'orca-list'",
-     "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'Mailing List'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'image'",
      "SPEECH OUTPUT: '('",
-     "SPEECH OUTPUT: 'orca-list'",
-     "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'Archives'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'image'",
@@ -113,10 +107,10 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'About'",
      "SPEECH OUTPUT: 'heading level 1'",
-     "SPEECH OUTPUT: 'Orca is a free, open source, flexible, extensible, and powerful assistive technology 
for people with visual impairments. Using various combinations of speech synthesis, braille, and 
magnification, Orca helps provide access to applications and toolkits that support the AT-SPI (e.g., the 
GNOME desktop). The development of Orca has been led by the'",
-     "SPEECH OUTPUT: 'access'",
-     "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: 'link'",
+     "SPEECH OUTPUT: 'Orca is a free, open source, flexible, extensible, and powerful assistive technology 
for people with visual impairments.'",
+     "SPEECH OUTPUT: 'Using various combinations of speech synthesis, braille, and magnification, Orca helps 
provide access to applications and toolkits that support the AT-SPI \(e.g.,",
+     "SPEECH OUTPUT: 'the GNOME desktop\).",
+     "SPEECH OUTPUT: 'The development of Orca has been led by the'",
      "SPEECH OUTPUT: 'Accessibility Program Office of Sun Microsystems, Inc.'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'image'",
@@ -125,9 +119,6 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: '.'",
      "SPEECH OUTPUT: 'The complete list of work to do, including bugs and feature requests, along with known 
problems in other components, is maintained in'",
-     "SPEECH OUTPUT: 'buglist'",
-     "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'Bugzilla'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'image'",
@@ -136,16 +127,10 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: ').'",
      "SPEECH OUTPUT: 'Please join and participate on the'",
-     "SPEECH OUTPUT: 'orca-list'",
-     "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'Orca mailing list'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'image'",
      "SPEECH OUTPUT: '('",
-     "SPEECH OUTPUT: 'orca-list'",
-     "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'archives'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'image'",
@@ -155,48 +140,34 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'Darragh \xd3 H\xe9iligh'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: 'has created several audio guides for Orca. This is a fantastic contribution 
(THANKS!)!!! The audio guides can be found at'",
-     "SPEECH OUTPUT: 'linuxat'",
-     "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: 'link'",
+     "SPEECH OUTPUT: 'has created several audio guides for Orca.'",
+     "SPEECH OUTPUT: 'This is a fantastic contribution (THANKS!)!!!'",
+     "SPEECH OUTPUT: 'The audio guides can be found at'",
      "SPEECH OUTPUT: 'http://www.digitaldarragh.com/linuxat.asp'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'image'",
      "SPEECH OUTPUT: 'and include the following:'",
      "SPEECH OUTPUT: '•'",
-     "SPEECH OUTPUT: 'ubuntu-7-4-install-walk-through'",
-     "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'Walk through of the installation of Ubuntu 7.4. Very helpful tutorial'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'image'",
      "SPEECH OUTPUT: '•'",
-     "SPEECH OUTPUT: 'linux-and-orca-review'",
-     "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'Review of Fedora 7 and the Orca screen reader for the Gnome graphical desktop'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'image'",
      "SPEECH OUTPUT: '•'",
-     "SPEECH OUTPUT: 'installing-firefox-and-orca'",
-     "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'Guide to installing the latest versions of Firefox and Orca'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'image'",
      "SPEECH OUTPUT: 'Download/Installation'",
      "SPEECH OUTPUT: 'heading level 1'",
-     "SPEECH OUTPUT: 'As of GNOME 2.16, Orca is a part of the GNOME platform. As a result, Orca is already 
provided by default on a number of operating system distributions, including'",
-     "SPEECH OUTPUT: 'www.opensolaris.org'",
-     "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: 'link'",
+     "SPEECH OUTPUT: 'As of GNOME 2.16,'",
+     "SPEECH OUTPUT: 'Orca is a part of the GNOME platform.'",
+     "SPEECH OUTPUT: 'As a result, Orca is already provided by default on a number of operating system 
distributions, including'",
      "SPEECH OUTPUT: 'Open Solaris'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'image'",
      "SPEECH OUTPUT: 'and'",
-     "SPEECH OUTPUT: 'www.ubuntu.com'",
-     "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'Ubuntu'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'image'",
@@ -207,23 +178,25 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'for detailed information on various distributions as well as installing Orca directly 
from source.'",
      "SPEECH OUTPUT: 'Configuration/Use'",
      "SPEECH OUTPUT: 'heading level 1'",
-     "SPEECH OUTPUT: 'The command to run orca is orca. You can enter this command by pressing Alt+F2 when 
logged in, waiting for a second or so, then typing orca and pressing return. Orca is designed to present 
information as you navigate the desktop using the'",
-     "SPEECH OUTPUT: 'keynav-1'",
-     "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: 'link'",
+     "SPEECH OUTPUT: 'The command to run orca is orca.'",
+     "SPEECH OUTPUT: 'You can enter this command by pressing Alt+F2 when logged in, waiting for a second or 
so, then typing orca and pressing return.'",
+     "SPEECH OUTPUT: 'Orca is designed to present information as you navigate the desktop using the'",
      "SPEECH OUTPUT: 'built-in navigation mechanisms of GNOME'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: '. These navigation mechanisms are consistent across most desktop applications.'",
+     "SPEECH OUTPUT: '.'",
+     "SPEECH OUTPUT: 'These navigation mechanisms are consistent across most desktop applications.'",
      "SPEECH OUTPUT: 'You may sometimes wish to control Orca itself, such as bringing up the'",
      "SPEECH OUTPUT: 'Orca Configuration GUI'",
      "SPEECH OUTPUT: 'link'",
-     "SPEECH OUTPUT: '(accessed by pressing Insert+Space when Orca is running) and for using flat review 
mode to examine a window. Refer to'",
+     "SPEECH OUTPUT: '(accessed by pressing Insert+Space when Orca is running) and for using flat review 
mode to examine a window.'",
+     "SPEECH OUTPUT: 'Refer to'",
      "SPEECH OUTPUT: 'Orca Keyboard Commands'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: '(Laptop Layout)'",
      "SPEECH OUTPUT: 'link'",
-     "SPEECH OUTPUT: 'for more information on Orca-specific keyboard commands. The'",
+     "SPEECH OUTPUT: 'for more information on Orca-specific keyboard commands.'",
+     "SPEECH OUTPUT: 'The'",
      "SPEECH OUTPUT: 'Orca Configuration GUI'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'also includes a \"Key Bindings\" tab that allows you to get a complete list of Orca 
key bindings.'",
@@ -233,14 +206,18 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'for detailed information.'",
      "SPEECH OUTPUT: 'Accessible Applications'",
      "SPEECH OUTPUT: 'heading level 1'",
-     "SPEECH OUTPUT: 'Orca is designed to work with applications and toolkits that support the assistive 
technology service provider interface (AT-SPI). This includes the GNOME desktop and its applications,'",
+     "SPEECH OUTPUT: 'Orca is designed to work with applications and toolkits that support the assistive 
technology service provider interface (AT-SPI).'",
+     "SPEECH OUTPUT: 'This includes the GNOME desktop and its applications,'",
      "SPEECH OUTPUT: 'OpenOffice'",
      "SPEECH OUTPUT: 'link'",
-     "SPEECH OUTPUT: ', Firefox, and the Java platform. Some applications work better than others, however, 
and the Orca community continually works to provide compelling access to more and more applications.'",
+     "SPEECH OUTPUT: ', Firefox, and the Java platform.'",
+     "SPEECH OUTPUT: 'Some applications work better than others, however, and the Orca community continually 
works to provide compelling access to more and more applications.'",
      "SPEECH OUTPUT: 'On the'",
      "SPEECH OUTPUT: 'Accessible Applications page'",
      "SPEECH OUTPUT: 'link'",
-     "SPEECH OUTPUT: ', you will find a growing list of information regarding various applications that can 
be accessed with Orca as well as tips and tricks for using them. The list is not to be a conclusive list of 
all applications. Rather, the goal is to provide a repository within which users can share experiences 
regarding applications they have tested.'",
+     "SPEECH OUTPUT: ', you will find a growing list of information regarding various applications that can 
be accessed with Orca as well as tips and tricks for using them.'",
+     "SPEECH OUTPUT: 'The list is not to be a conclusive list of all applications.'",
+     "SPEECH OUTPUT: 'Rather, the goal is to provide a repository within which users can share experiences 
regarding applications they have tested.'",
      "SPEECH OUTPUT: 'See also the'",
      "SPEECH OUTPUT: 'Application Specific Settings'",
      "SPEECH OUTPUT: 'link'",
@@ -251,7 +228,8 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'for detailed information.'",
      "SPEECH OUTPUT: 'How Can I Help?'",
      "SPEECH OUTPUT: 'heading level 1'",
-     "SPEECH OUTPUT: 'There's a bunch you can do! Please refer to the'",
+     "SPEECH OUTPUT: 'There's a bunch you can do!'",
+     "SPEECH OUTPUT: 'Please refer to the'",
      "SPEECH OUTPUT: 'How Can I Help page'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'for detailed information.'",
@@ -263,62 +241,38 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: '•'",
      "SPEECH OUTPUT: 'Mailing list:'",
-     "SPEECH OUTPUT: 'orca-list'",
-     "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'orca-list gnome org'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'image'",
      "SPEECH OUTPUT: '('",
-     "SPEECH OUTPUT: 'orca-list'",
-     "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'Archives'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'image'",
      "SPEECH OUTPUT: ')'",
      "SPEECH OUTPUT: '•'",
      "SPEECH OUTPUT: 'Bug database:'",
-     "SPEECH OUTPUT: 'bugzilla.gnome.org'",
-     "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'GNOME Bug Tracking System (Bugzilla)'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'image'",
      "SPEECH OUTPUT: '('",
-     "SPEECH OUTPUT: 'buglist'",
-     "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'current bug list'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'image'",
      "SPEECH OUTPUT: ')'",
      "SPEECH OUTPUT: '•'",
      "SPEECH OUTPUT: 'Design documents:'",
-     "SPEECH OUTPUT: 'orca'",
-     "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'Orca Documentation Series'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'image'",
      "SPEECH OUTPUT: '•'",
-     "SPEECH OUTPUT: 'www.diveintopython.org'",
-     "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'Dive Into Python, Mark Pilgrim'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'image'",
      "SPEECH OUTPUT: '•'",
-     "SPEECH OUTPUT: '103-6779448-2183842'",
-     "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'Python in a Nutshell, Alex Martelli'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'image'",
      "SPEECH OUTPUT: '•'",
-     "SPEECH OUTPUT: '103-6779448-2183842'",
-     "SPEECH OUTPUT: 'image'",
-     "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'Python Pocket Reference, Mark Lutz'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'image'",
@@ -341,8 +295,6 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'Info'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: 'Attachments'",
-     "SPEECH OUTPUT: 'link'",
-     "SPEECH OUTPUT: 'Attachments'",
      "SPEECH OUTPUT: 'More Actions:'",
      "SPEECH OUTPUT: 'combo box'",
      "SPEECH OUTPUT: 'GNOME World Wide'",
@@ -353,8 +305,8 @@ sequence.append(utils.AssertPresentationAction(
      "SPEECH OUTPUT: 'Copyright \xa9 2005, 2006, 2007'",
      "SPEECH OUTPUT: 'The GNOME Project'",
      "SPEECH OUTPUT: 'link'",
-     "SPEECH OUTPUT: '.",
-     "Hosted by'",
+     "SPEECH OUTPUT: '.'",
+     "SPEECH OUTPUT: 'Hosted by'",
      "SPEECH OUTPUT: 'Red Hat'",
      "SPEECH OUTPUT: 'link'",
      "SPEECH OUTPUT: '.'"]))


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