ignore parameters, foldes, numeric, decimal and some more in spellcheck, replace strip == empty check with faster isspace
This commit is contained in:
parent
f6209f8b4c
commit
1c2d0caa56
@ -39,7 +39,7 @@ class command():
|
|||||||
else:
|
else:
|
||||||
x, y, marked = \
|
x, y, marked = \
|
||||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
||||||
if marked.strip(" \t\n") == '':
|
if marked.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
||||||
|
@ -39,7 +39,7 @@ class command():
|
|||||||
else:
|
else:
|
||||||
x, y, marked = \
|
x, y, marked = \
|
||||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
||||||
if marked.strip(" \t\n") == '':
|
if marked.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
||||||
|
@ -39,7 +39,7 @@ class command():
|
|||||||
else:
|
else:
|
||||||
x, y, marked = \
|
x, y, marked = \
|
||||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
||||||
if marked.strip(" \t\n") == '':
|
if marked.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
||||||
|
@ -39,7 +39,7 @@ class command():
|
|||||||
else:
|
else:
|
||||||
x, y, marked = \
|
x, y, marked = \
|
||||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
||||||
if marked.strip(" \t\n") == '':
|
if marked.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
||||||
|
@ -39,7 +39,7 @@ class command():
|
|||||||
else:
|
else:
|
||||||
x, y, marked = \
|
x, y, marked = \
|
||||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
||||||
if marked.strip(" \t\n") == '':
|
if marked.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
||||||
|
@ -39,7 +39,7 @@ class command():
|
|||||||
else:
|
else:
|
||||||
x, y, marked = \
|
x, y, marked = \
|
||||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
||||||
if marked.strip(" \t\n") == '':
|
if marked.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
||||||
|
@ -39,7 +39,7 @@ class command():
|
|||||||
else:
|
else:
|
||||||
x, y, marked = \
|
x, y, marked = \
|
||||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
||||||
if marked.strip(" \t\n") == '':
|
if marked.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
||||||
|
@ -39,7 +39,7 @@ class command():
|
|||||||
else:
|
else:
|
||||||
x, y, marked = \
|
x, y, marked = \
|
||||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
||||||
if marked.strip(" \t\n") == '':
|
if marked.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
||||||
|
@ -39,7 +39,7 @@ class command():
|
|||||||
else:
|
else:
|
||||||
x, y, marked = \
|
x, y, marked = \
|
||||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
||||||
if marked.strip(" \t\n") == '':
|
if marked.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
||||||
|
@ -39,7 +39,7 @@ class command():
|
|||||||
else:
|
else:
|
||||||
x, y, marked = \
|
x, y, marked = \
|
||||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
||||||
if marked.strip(" \t\n") == '':
|
if marked.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
||||||
|
@ -34,7 +34,7 @@ class command():
|
|||||||
self.env['commandBuffer']['Marks']['1'] = None
|
self.env['commandBuffer']['Marks']['1'] = None
|
||||||
self.env['commandBuffer']['Marks']['2'] = None
|
self.env['commandBuffer']['Marks']['2'] = None
|
||||||
|
|
||||||
if marked.strip(" \t\n") == '':
|
if marked.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
||||||
|
@ -23,7 +23,7 @@ class command():
|
|||||||
x, y, currChar = \
|
x, y, currChar = \
|
||||||
char_utils.getCurrentChar(cursorPos['x'], cursorPos['y'], self.env['screenData']['newContentText'])
|
char_utils.getCurrentChar(cursorPos['x'], cursorPos['y'], self.env['screenData']['newContentText'])
|
||||||
|
|
||||||
if currChar.strip(" \t\n") == '':
|
if currChar.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank" ,interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank" ,interrupt=True)
|
||||||
else:
|
else:
|
||||||
currChar = char_utils.getPhonetic(currChar)
|
currChar = char_utils.getPhonetic(currChar)
|
||||||
|
@ -17,7 +17,7 @@ class command():
|
|||||||
return 'reads the contents of the current screen'
|
return 'reads the contents of the current screen'
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if self.env['screenData']['newContentText'].strip(" \t\n") == '':
|
if self.env['screenData']['newContentText'].isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("screen is empty", soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText("screen is empty", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(self.env['screenData']['newContentText'],interrupt=True)
|
self.env['runtime']['outputManager'].presentText(self.env['screenData']['newContentText'],interrupt=True)
|
||||||
|
@ -23,7 +23,7 @@ class command():
|
|||||||
|
|
||||||
textAfterCursor = mark_utils.getTextAfterMark(cursorPos, self.env['screenData']['newContentText'])
|
textAfterCursor = mark_utils.getTextAfterMark(cursorPos, self.env['screenData']['newContentText'])
|
||||||
|
|
||||||
if textAfterCursor.strip(" \t\n") == '':
|
if textAfterCursor.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(textAfterCursor, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(textAfterCursor, interrupt=True)
|
||||||
|
@ -26,7 +26,7 @@ class command():
|
|||||||
|
|
||||||
textBeforeCursor = mark_utils.getTextBeforeMark(cursorPos, self.env['screenData']['newContentText'])
|
textBeforeCursor = mark_utils.getTextBeforeMark(cursorPos, self.env['screenData']['newContentText'])
|
||||||
|
|
||||||
if textBeforeCursor.strip(" \t\n") == '':
|
if textBeforeCursor.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(textBeforeCursor, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(textBeforeCursor, interrupt=True)
|
||||||
|
@ -23,7 +23,7 @@ class command():
|
|||||||
x, y, currWord = \
|
x, y, currWord = \
|
||||||
word_utils.getCurrentWord(cursorPos['x'], cursorPos['y'], self.env['screenData']['newContentText'])
|
word_utils.getCurrentWord(cursorPos['x'], cursorPos['y'], self.env['screenData']['newContentText'])
|
||||||
|
|
||||||
if currWord.strip(" \t\n") == '':
|
if currWord.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", interrupt=True)
|
||||||
else:
|
else:
|
||||||
firstSequence = True
|
firstSequence = True
|
||||||
|
@ -27,7 +27,7 @@ class command():
|
|||||||
x, y, currLine = \
|
x, y, currLine = \
|
||||||
line_utils.getCurrentLine(cursorPos['x'], cursorPos['y'], self.env['screenData']['newContentText'])
|
line_utils.getCurrentLine(cursorPos['x'], cursorPos['y'], self.env['screenData']['newContentText'])
|
||||||
|
|
||||||
if currLine.strip(" \t\n") == '':
|
if currLine.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText("indent "+ str(len(currLine) - len(currLine.lstrip())), interrupt=True)
|
self.env['runtime']['outputManager'].presentText("indent "+ str(len(currLine) - len(currLine.lstrip())), interrupt=True)
|
||||||
|
@ -29,7 +29,7 @@ class command():
|
|||||||
|
|
||||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screenData']['newContentText'])
|
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screenData']['newContentText'])
|
||||||
|
|
||||||
if marked.strip(" \t\n") == '':
|
if marked.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
||||||
|
@ -21,7 +21,7 @@ class command():
|
|||||||
x, y, firstLine = \
|
x, y, firstLine = \
|
||||||
line_utils.getCurrentLine(0, 0, self.env['screenData']['newContentText'])
|
line_utils.getCurrentLine(0, 0, self.env['screenData']['newContentText'])
|
||||||
|
|
||||||
if firstLine.strip(" \t\n") == '':
|
if firstLine.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(firstLine, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(firstLine, interrupt=True)
|
||||||
|
@ -21,7 +21,7 @@ class command():
|
|||||||
x, y, lastLine = \
|
x, y, lastLine = \
|
||||||
line_utils.getCurrentLine(0, self.env['screenData']['lines'] -1, self.env['screenData']['newContentText'])
|
line_utils.getCurrentLine(0, self.env['screenData']['lines'] -1, self.env['screenData']['newContentText'])
|
||||||
|
|
||||||
if lastLine.strip(" \t\n") == '':
|
if lastLine.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(lastLine, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(lastLine, interrupt=True)
|
||||||
|
@ -44,7 +44,7 @@ class command():
|
|||||||
newContent = self.env['screenData']['newContentText'].split('\n')[cursorPos['y']]
|
newContent = self.env['screenData']['newContentText'].split('\n')[cursorPos['y']]
|
||||||
x, y, currWord = word_utils.getCurrentWord(cursorPos['x'], 0, newContent)
|
x, y, currWord = word_utils.getCurrentWord(cursorPos['x'], 0, newContent)
|
||||||
|
|
||||||
if currWord != '':
|
if not currWord.isspace():
|
||||||
if self.spellChecker.is_removed(currWord):
|
if self.spellChecker.is_removed(currWord):
|
||||||
self.env['runtime']['outputManager'].presentText(currWord + ' is already removed from dict',soundIcon='Cancel', interrupt=True)
|
self.env['runtime']['outputManager'].presentText(currWord + ' is already removed from dict',soundIcon='Cancel', interrupt=True)
|
||||||
else:
|
else:
|
||||||
|
@ -23,7 +23,7 @@ class command():
|
|||||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currChar = \
|
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currChar = \
|
||||||
char_utils.getCurrentChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
char_utils.getCurrentChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||||
|
|
||||||
if currChar.strip(" \t\n") == '':
|
if currChar.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank" ,interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank" ,interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True)
|
self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True)
|
||||||
|
@ -23,7 +23,7 @@ class command():
|
|||||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currLine = \
|
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currLine = \
|
||||||
line_utils.getCurrentLine(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
line_utils.getCurrentLine(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||||
|
|
||||||
if currLine.strip(" \t\n") == '':
|
if currLine.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(currLine, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(currLine, interrupt=True)
|
||||||
|
@ -23,7 +23,7 @@ class command():
|
|||||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currWord = \
|
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currWord = \
|
||||||
word_utils.getCurrentWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
word_utils.getCurrentWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||||
|
|
||||||
if currWord.strip(" \t\n") == '':
|
if currWord.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True)
|
||||||
|
@ -21,7 +21,7 @@ class command():
|
|||||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], downChar = \
|
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], downChar = \
|
||||||
char_utils.getDownChar(self.env['screenData']['newCursorReview']['x'],self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
char_utils.getDownChar(self.env['screenData']['newCursorReview']['x'],self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||||
if downChar.strip(" \t\n") == '':
|
if downChar.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("line is empty" ,interrupt=True)
|
self.env['runtime']['outputManager'].presentText("line is empty" ,interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(downChar ,interrupt=True, ignorePunctuation=True, announceCapital=True)
|
self.env['runtime']['outputManager'].presentText(downChar ,interrupt=True, ignorePunctuation=True, announceCapital=True)
|
||||||
|
@ -23,7 +23,7 @@ class command():
|
|||||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currChar = \
|
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currChar = \
|
||||||
char_utils.getCurrentChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
char_utils.getCurrentChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||||
|
|
||||||
if currChar.strip(" \t\n") == '':
|
if currChar.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank" ,interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank" ,interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True)
|
self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True)
|
||||||
|
@ -23,8 +23,8 @@ class command():
|
|||||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currChar = \
|
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currChar = \
|
||||||
char_utils.getCurrentChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
char_utils.getCurrentChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||||
|
|
||||||
if currChar.strip(" \t\n") == '':
|
if currChar.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank" ,interrupt=True)
|
self.env['runtime']['outputManager'].presentText("space" ,interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True)
|
self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True)
|
||||||
self.env['runtime']['outputManager'].presentText("end of line", interrupt=False)
|
self.env['runtime']['outputManager'].presentText("end of line", interrupt=False)
|
||||||
|
@ -23,7 +23,7 @@ class command():
|
|||||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], lastChar = \
|
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], lastChar = \
|
||||||
char_utils.getLastCharInLine(self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
char_utils.getLastCharInLine(self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||||
|
|
||||||
if lastChar.strip(" \t\n") == '':
|
if lastChar.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("line is empty" ,interrupt=True)
|
self.env['runtime']['outputManager'].presentText("line is empty" ,interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(lastChar ,interrupt=True, ignorePunctuation=True, announceCapital=True)
|
self.env['runtime']['outputManager'].presentText(lastChar ,interrupt=True, ignorePunctuation=True, announceCapital=True)
|
||||||
|
@ -25,8 +25,8 @@ class command():
|
|||||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currChar = \
|
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currChar = \
|
||||||
char_utils.getNextChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
char_utils.getNextChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||||
|
|
||||||
if currChar.strip(" \t\n") == '':
|
if currChar.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", interrupt=True)
|
self.env['runtime']['outputManager'].presentText("space", interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True)
|
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True)
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ class command():
|
|||||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currLine = \
|
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currLine = \
|
||||||
line_utils.getNextLine(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
line_utils.getNextLine(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||||
|
|
||||||
if currLine.strip(" \t\n") == '':
|
if currLine.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(currLine, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(currLine, interrupt=True)
|
||||||
|
@ -25,7 +25,7 @@ class command():
|
|||||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currWord = \
|
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currWord = \
|
||||||
word_utils.getNextWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
word_utils.getNextWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||||
|
|
||||||
if currWord.strip(" \t\n") == '':
|
if currWord.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True)
|
||||||
|
@ -25,8 +25,8 @@ class command():
|
|||||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currChar = \
|
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currChar = \
|
||||||
char_utils.getPrevChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
char_utils.getPrevChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||||
|
|
||||||
if currChar.strip(" \t\n") == '':
|
if currChar.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", interrupt=True)
|
self.env['runtime']['outputManager'].presentText("space", interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True)
|
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True)
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ class command():
|
|||||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currLine = \
|
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currLine = \
|
||||||
line_utils.getPrevLine(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
line_utils.getPrevLine(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||||
|
|
||||||
if currLine.strip(" \t\n") == '':
|
if currLine.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(currLine, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(currLine, interrupt=True)
|
||||||
|
@ -23,7 +23,7 @@ class command():
|
|||||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currWord = \
|
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currWord = \
|
||||||
word_utils.getPrevWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
word_utils.getPrevWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||||
|
|
||||||
if currWord.strip(" \t\n") == '':
|
if currWord.isspace()':
|
||||||
self.env['runtime']['outputManager'].presentText("blank", interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True)
|
||||||
|
@ -21,7 +21,7 @@ class command():
|
|||||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], upChar = \
|
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], upChar = \
|
||||||
char_utils.getUpChar(self.env['screenData']['newCursorReview']['x'],self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
char_utils.getUpChar(self.env['screenData']['newCursorReview']['x'],self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||||
if upChar.strip(" \t\n") == '':
|
if upChar.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("line is empty" ,interrupt=True)
|
self.env['runtime']['outputManager'].presentText("line is empty" ,interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(upChar ,interrupt=True, ignorePunctuation=True, announceCapital=True)
|
self.env['runtime']['outputManager'].presentText(upChar ,interrupt=True, ignorePunctuation=True, announceCapital=True)
|
||||||
|
@ -44,9 +44,10 @@ class command():
|
|||||||
newContent = self.env['screenData']['newContentText'].split('\n')[cursorPos['y']]
|
newContent = self.env['screenData']['newContentText'].split('\n')[cursorPos['y']]
|
||||||
x, y, currWord = word_utils.getCurrentWord(cursorPos['x'], 0, newContent)
|
x, y, currWord = word_utils.getCurrentWord(cursorPos['x'], 0, newContent)
|
||||||
|
|
||||||
if currWord != '':
|
if not currWord.isspace():
|
||||||
if not self.spellChecker.check(currWord):
|
if not self.spellChecker.check(currWord):
|
||||||
self.env['runtime']['outputManager'].presentText('misspelled',soundIcon='mispell', interrupt=True)
|
self.env['runtime']['outputManager'].presentText('misspelled',soundIcon='mispell', interrupt=True)
|
||||||
|
elif not ignore:
|
||||||
|
self.env['runtime']['outputManager'].presentText('correct',soundIcon='', interrupt=True)
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -31,7 +31,7 @@ class command():
|
|||||||
self.env['screenData']['newCursor']['x'] == self.env['screenData']['oldCursor']['x']:
|
self.env['screenData']['newCursor']['x'] == self.env['screenData']['oldCursor']['x']:
|
||||||
return
|
return
|
||||||
currChar = self.env['screenData']['newContentText'].split('\n')[self.env['screenData']['newCursor']['y']][self.env['screenData']['newCursor']['x']]
|
currChar = self.env['screenData']['newContentText'].split('\n')[self.env['screenData']['newCursor']['y']][self.env['screenData']['newCursor']['x']]
|
||||||
if not currChar.strip(" \t\n") == '':
|
if not currChar.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True)
|
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True)
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
@ -28,7 +28,7 @@ class command():
|
|||||||
if self.env['runtime']['inputManager'].noKeyPressed():
|
if self.env['runtime']['inputManager'].noKeyPressed():
|
||||||
return
|
return
|
||||||
currLine = self.env['screenData']['newContentText'].split('\n')[self.env['screenData']['newCursor']['y']]
|
currLine = self.env['screenData']['newContentText'].split('\n')[self.env['screenData']['newCursor']['y']]
|
||||||
if currLine.strip(" \t\n") == '':
|
if currLine.isspace():
|
||||||
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True)
|
||||||
else:
|
else:
|
||||||
self.env['runtime']['outputManager'].presentText(currLine, interrupt=True)
|
self.env['runtime']['outputManager'].presentText(currLine, interrupt=True)
|
||||||
|
@ -69,9 +69,26 @@ class command():
|
|||||||
if not(newContent[self.env['screenData']['newCursor']['x']].strip(" \t\n") == '' and x != self.env['screenData']['newCursor']['x']):
|
if not(newContent[self.env['screenData']['newCursor']['x']].strip(" \t\n") == '' and x != self.env['screenData']['newCursor']['x']):
|
||||||
return
|
return
|
||||||
|
|
||||||
if currWord != '':
|
if currWord == '':
|
||||||
if not self.spellChecker.check(currWord):
|
return
|
||||||
self.env['runtime']['outputManager'].presentText('misspelled',soundIcon='mispell', interrupt=False)
|
if currWord.startswith('-'):
|
||||||
|
return
|
||||||
|
if currWord.startswith('/'):
|
||||||
|
return
|
||||||
|
if currWord.startswith('#'):
|
||||||
|
return
|
||||||
|
if currWord.startswith('./'):
|
||||||
|
return
|
||||||
|
if currWord.startswith('@'):
|
||||||
|
return
|
||||||
|
if currWord.isnumeric():
|
||||||
|
return
|
||||||
|
if currWord.isdecimal():
|
||||||
|
return
|
||||||
|
if currWord.isspace():
|
||||||
|
return
|
||||||
|
if not self.spellChecker.check(currWord):
|
||||||
|
self.env['runtime']['outputManager'].presentText('misspelled',soundIcon='mispell', interrupt=False)
|
||||||
|
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user