diff --git a/config/punctuation/default.conf b/config/punctuation/default.conf index 316b5783..7a151fc3 100644 --- a/config/punctuation/default.conf +++ b/config/punctuation/default.conf @@ -6,9 +6,10 @@ none:===: some:===:.-$~+*-/\@ most:===:.,:-$~+*-/\@!#%^&*()[]}{<>; -all:===:!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ +all:===:!"#$%& \'()*+,-./:;<=>?@[\\]^_`{|}~ [punctDict] + :===:spacasdfe &:===:and ':===:apostrophe @:===:at diff --git a/config/settings/espeak.settings.conf b/config/settings/espeak.settings.conf index a54c9c5a..187ef59c 100644 --- a/config/settings/espeak.settings.conf +++ b/config/settings/espeak.settings.conf @@ -117,7 +117,7 @@ cursor=True highlight=False [review] -newLine=True +lineBreak=True endOfScreen=True [promote] diff --git a/config/settings/settings.conf b/config/settings/settings.conf index c50c5193..3bf30df7 100644 --- a/config/settings/settings.conf +++ b/config/settings/settings.conf @@ -119,7 +119,7 @@ cursor=True highlight=False [review] -newLine=True +lineBreak=True endOfScreen=True [promote] diff --git a/config/settings/settings.conf.chrys b/config/settings/settings.conf.chrys index a7d62d6b..55292a33 100644 --- a/config/settings/settings.conf.chrys +++ b/config/settings/settings.conf.chrys @@ -119,7 +119,7 @@ cursor=True highlight=False [review] -newLine=True +lineBreak=True endOfScreen=True [promote] diff --git a/config/settings/settings.conf.storm b/config/settings/settings.conf.storm index 7bebda6f..16df3d0f 100644 --- a/config/settings/settings.conf.storm +++ b/config/settings/settings.conf.storm @@ -69,7 +69,7 @@ cursor=True highlight=False [review] -newLine=True +lineBreak=True endOfScreen=True [promote] diff --git a/src/fenrir/commands/commands/review_curr_char.py b/src/fenrir/commands/commands/review_curr_char.py index 993f5929..d5839d02 100644 --- a/src/fenrir/commands/commands/review_curr_char.py +++ b/src/fenrir/commands/commands/review_curr_char.py @@ -23,10 +23,7 @@ class command(): 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']) - if currChar.isspace(): - self.env['runtime']['outputManager'].presentText("blank" ,interrupt=True) - 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) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_down.py b/src/fenrir/commands/commands/review_down.py index db7137e0..e948656b 100644 --- a/src/fenrir/commands/commands/review_down.py +++ b/src/fenrir/commands/commands/review_down.py @@ -15,16 +15,15 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'set review cursor to end of current line and display the content' + return 'set review cursor to char below the current char and present it.' def run(self): cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor() self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], downChar, endOfScreen = \ char_utils.getDownChar(self.env['screenData']['newCursorReview']['x'],self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText']) - if downChar.isspace(): - self.env['runtime']['outputManager'].presentText("line is empty" ,interrupt=True) - 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) + if endOfScreen: + if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): + self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=False, soundIcon='EndOfScreen') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_line_end.py b/src/fenrir/commands/commands/review_line_end.py index 9bb30561..ec94c145 100644 --- a/src/fenrir/commands/commands/review_line_end.py +++ b/src/fenrir/commands/commands/review_line_end.py @@ -23,10 +23,7 @@ class command(): 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']) - if currChar.isspace(): - self.env['runtime']['outputManager'].presentText("space" ,interrupt=True) - 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) def setCallback(self, callback): diff --git a/src/fenrir/commands/commands/review_line_last_char.py b/src/fenrir/commands/commands/review_line_last_char.py index bb405abd..3577e033 100644 --- a/src/fenrir/commands/commands/review_line_last_char.py +++ b/src/fenrir/commands/commands/review_line_last_char.py @@ -23,11 +23,8 @@ class command(): self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], lastChar = \ char_utils.getLastCharInLine(self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText']) - if lastChar.isspace(): - self.env['runtime']['outputManager'].presentText("line is empty" ,interrupt=True) - else: - self.env['runtime']['outputManager'].presentText(lastChar ,interrupt=True, ignorePunctuation=True, announceCapital=True) - self.env['runtime']['outputManager'].presentText("last char in line", interrupt=False) + self.env['runtime']['outputManager'].presentText(lastChar ,interrupt=True, ignorePunctuation=True, announceCapital=True) + self.env['runtime']['outputManager'].presentText("last char in line", interrupt=False) def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_next_char.py b/src/fenrir/commands/commands/review_next_char.py index b5667f4e..395c0217 100644 --- a/src/fenrir/commands/commands/review_next_char.py +++ b/src/fenrir/commands/commands/review_next_char.py @@ -21,11 +21,13 @@ class command(): self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor() self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], nextChar, endOfScreen, lineBreak = \ char_utils.getNextChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText']) - - if nextChar.isspace(): - self.env['runtime']['outputManager'].presentText("space", interrupt=True) - else: - self.env['runtime']['outputManager'].presentText(nextChar, interrupt=True, ignorePunctuation=True, announceCapital=True) - + + self.env['runtime']['outputManager'].presentText(nextChar, interrupt=True, ignorePunctuation=True, announceCapital=True) + if endOfScreen: + if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): + self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=False, soundIcon='EndOfScreen') + if lineBreak: + if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): + self.env['runtime']['outputManager'].presentText('line break' ,interrupt=False, soundIcon='EndOfLine') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_next_char_phonetic.py b/src/fenrir/commands/commands/review_next_char_phonetic.py index 1b76ddd7..1aaabebb 100644 --- a/src/fenrir/commands/commands/review_next_char_phonetic.py +++ b/src/fenrir/commands/commands/review_next_char_phonetic.py @@ -23,11 +23,13 @@ class command(): self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], nextChar, endOfScreen, lineBreak = \ char_utils.getNextChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText']) - if nextChar.isspace(): - self.env['runtime']['outputManager'].presentText("blank" ,interrupt=True) - else: - nextChar = char_utils.getPhonetic(nextChar) - self.env['runtime']['outputManager'].presentText(nextChar ,interrupt=True, announceCapital=True) - + nextChar = char_utils.getPhonetic(nextChar) + self.env['runtime']['outputManager'].presentText(nextChar ,interrupt=True, announceCapital=True) + if endOfScreen: + if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): + self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=False, soundIcon='EndOfScreen') + if lineBreak: + if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): + self.env['runtime']['outputManager'].presentText('line break' ,interrupt=False, soundIcon='EndOfLine') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_next_line.py b/src/fenrir/commands/commands/review_next_line.py index 165508dc..18bdfc11 100644 --- a/src/fenrir/commands/commands/review_next_line.py +++ b/src/fenrir/commands/commands/review_next_line.py @@ -29,6 +29,8 @@ class command(): self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True) else: self.env['runtime']['outputManager'].presentText(nextLine, interrupt=True) - + if endOfScreen: + if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): + self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=False, soundIcon='EndOfScreen') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_next_word.py b/src/fenrir/commands/commands/review_next_word.py index 5607c492..2ba07189 100644 --- a/src/fenrir/commands/commands/review_next_word.py +++ b/src/fenrir/commands/commands/review_next_word.py @@ -29,6 +29,11 @@ class command(): self.env['runtime']['outputManager'].presentText("blank", interrupt=True) else: self.env['runtime']['outputManager'].presentText(nextWord, interrupt=True) - + if endOfScreen: + if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): + self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=False, soundIcon='EndOfScreen') + if lineBreak: + if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): + self.env['runtime']['outputManager'].presentText('line break' ,interrupt=False, soundIcon='EndOfLine') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_next_word_phonetic.py b/src/fenrir/commands/commands/review_next_word_phonetic.py index 6dea9f1b..9c544ef5 100644 --- a/src/fenrir/commands/commands/review_next_word_phonetic.py +++ b/src/fenrir/commands/commands/review_next_word_phonetic.py @@ -31,6 +31,11 @@ class command(): currChar = char_utils.getPhonetic(c) self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence, announceCapital=True) firstSequence = False - + if endOfScreen: + if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): + self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=False, soundIcon='EndOfScreen') + if lineBreak: + if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): + self.env['runtime']['outputManager'].presentText('line break' ,interrupt=False, soundIcon='EndOfLine') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_prev_char.py b/src/fenrir/commands/commands/review_prev_char.py index 22d8a3cb..d8f07ed5 100644 --- a/src/fenrir/commands/commands/review_prev_char.py +++ b/src/fenrir/commands/commands/review_prev_char.py @@ -25,10 +25,12 @@ class command(): self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], prevChar, endOfScreen, lineBreak = \ char_utils.getPrevChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText']) - if prevChar.isspace(): - self.env['runtime']['outputManager'].presentText("space", interrupt=True) - else: - self.env['runtime']['outputManager'].presentText(prevChar, interrupt=True, ignorePunctuation=True, announceCapital=True) - + self.env['runtime']['outputManager'].presentText(prevChar, interrupt=True, ignorePunctuation=True, announceCapital=True) + if endOfScreen: + if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): + self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=False, soundIcon='EndOfScreen') + if lineBreak: + if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): + self.env['runtime']['outputManager'].presentText('line break' ,interrupt=False, soundIcon='EndOfLine') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_prev_char_phonetic.py b/src/fenrir/commands/commands/review_prev_char_phonetic.py index 5340cdde..c2eb1669 100644 --- a/src/fenrir/commands/commands/review_prev_char_phonetic.py +++ b/src/fenrir/commands/commands/review_prev_char_phonetic.py @@ -23,11 +23,13 @@ class command(): self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], prevChar, endOfScreen, lineBreak = \ char_utils.getPrevChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText']) - if prevChar.isspace(): - self.env['runtime']['outputManager'].presentText("blank" ,interrupt=True) - else: - prevChar = char_utils.getPhonetic(prevChar) - self.env['runtime']['outputManager'].presentText(prevChar ,interrupt=True, announceCapital=True) - + prevChar = char_utils.getPhonetic(prevChar) + self.env['runtime']['outputManager'].presentText(prevChar ,interrupt=True, announceCapital=True) + if endOfScreen: + if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): + self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=False, soundIcon='EndOfScreen') + if lineBreak: + if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): + self.env['runtime']['outputManager'].presentText('line break' ,interrupt=False, soundIcon='EndOfLine') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_prev_line.py b/src/fenrir/commands/commands/review_prev_line.py index 85e1803e..45707e1d 100644 --- a/src/fenrir/commands/commands/review_prev_line.py +++ b/src/fenrir/commands/commands/review_prev_line.py @@ -27,6 +27,9 @@ class command(): self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True) else: self.env['runtime']['outputManager'].presentText(prevLine, interrupt=True) + if endOfScreen: + if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): + self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=False, soundIcon='EndOfScreen') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_prev_word.py b/src/fenrir/commands/commands/review_prev_word.py index d7dfc306..1a53e1cd 100644 --- a/src/fenrir/commands/commands/review_prev_word.py +++ b/src/fenrir/commands/commands/review_prev_word.py @@ -27,6 +27,11 @@ class command(): self.env['runtime']['outputManager'].presentText("blank", interrupt=True) else: self.env['runtime']['outputManager'].presentText(prevWord, interrupt=True) - + if endOfScreen: + if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): + self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=False, soundIcon='EndOfScreen') + if lineBreak: + if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): + self.env['runtime']['outputManager'].presentText('line break' ,interrupt=False, soundIcon='EndOfLine') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_prev_word_phonetic.py b/src/fenrir/commands/commands/review_prev_word_phonetic.py index b701d70f..5e0f1ddf 100644 --- a/src/fenrir/commands/commands/review_prev_word_phonetic.py +++ b/src/fenrir/commands/commands/review_prev_word_phonetic.py @@ -31,6 +31,11 @@ class command(): currChar = char_utils.getPhonetic(c) self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence, announceCapital=True) firstSequence = False - + if endOfScreen: + if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): + self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=False, soundIcon='EndOfScreen') + if lineBreak: + if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): + self.env['runtime']['outputManager'].presentText('line break' ,interrupt=False, soundIcon='EndOfLine') def setCallback(self, callback): pass diff --git a/src/fenrir/commands/commands/review_up.py b/src/fenrir/commands/commands/review_up.py index 94d23461..ba835b22 100644 --- a/src/fenrir/commands/commands/review_up.py +++ b/src/fenrir/commands/commands/review_up.py @@ -15,16 +15,18 @@ class command(): def shutdown(self): pass def getDescription(self): - return 'set review cursor to end of current line and display the content' + return 'set review cursor to the char in the line below and present it' def run(self): cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor() self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], upChar, endOfScreen = \ char_utils.getUpChar(self.env['screenData']['newCursorReview']['x'],self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText']) - if upChar.isspace(): - self.env['runtime']['outputManager'].presentText("line is empty" ,interrupt=True) - 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) + if endOfScreen: + if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): + self.env['runtime']['outputManager'].presentText('end of screen' ,interrupt=False, soundIcon='EndOfScreen') + if lineBreak: + if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): + self.env['runtime']['outputManager'].presentText('line break' ,interrupt=False, soundIcon='EndOfLine') def setCallback(self, callback): pass diff --git a/src/fenrir/core/outputManager.py b/src/fenrir/core/outputManager.py index 9aaf759b..adf35832 100644 --- a/src/fenrir/core/outputManager.py +++ b/src/fenrir/core/outputManager.py @@ -28,7 +28,7 @@ class outputManager(): if self.playSoundIcon(soundIcon, interrupt): self.env['runtime']['debug'].writeDebugOut("soundIcon found" ,debug.debugLevel.INFO) return - if text.strip(string.whitespace) == '': + if (len(text) > 1) and (text.strip(string.whitespace) == ''): return toAnnounceCapital = announceCapital and text[0].isupper() if toAnnounceCapital: diff --git a/src/fenrir/core/punctuation.py b/src/fenrir/core/punctuation.py index b1327253..e896b8e9 100644 --- a/src/fenrir/core/punctuation.py +++ b/src/fenrir/core/punctuation.py @@ -11,10 +11,11 @@ punctuation = { 'LEVELDICT':{ 'none': '', 'some': '#-$~+*-/\\@', - 'most': '.,:-$~+*-/\\@!#%^&*()[]}{<>;', - 'all': string.punctuation + '§', + 'most': '.,:-$~ +*-/\\@!#%^&*()[]}{<>;', + 'all': string.punctuation + ' §', }, 'PUNCTDICT':{ + ' ':'space', '&':'and', "'":"apostrophe", '@':'at', diff --git a/src/fenrir/core/punctuationManager.py b/src/fenrir/core/punctuationManager.py index f6fe3e70..2aa14f25 100644 --- a/src/fenrir/core/punctuationManager.py +++ b/src/fenrir/core/punctuationManager.py @@ -12,7 +12,7 @@ class punctuationManager(): pass def initialize(self, environment): self.env = environment - self.allPunctNone = dict.fromkeys(map(ord, string.punctuation +"§"), ' ') + self.allPunctNone = dict.fromkeys(map(ord, string.punctuation +"§ "), ' ') # replace with None: # dot, comma, grave, apostrophe #for char in [ord('`'),ord("'")]: @@ -62,7 +62,7 @@ class punctuationManager(): if not ignorePunctuation and self.env['runtime']['settingsManager'].getSetting('general', 'punctuationLevel').lower() in self.env['punctuation']['LEVELDICT']: currPunctLevel = self.env['punctuation']['LEVELDICT'][self.env['runtime']['settingsManager'].getSetting('general', 'punctuationLevel').lower()] else: - currPunctLevel = string.punctuation +'§' + currPunctLevel = string.punctuation +' §' resultText = self.usePunctuationDict(resultText, self.env['punctuation']['PUNCTDICT'], currPunctLevel) #resultText = self.removeUnused(resultText, currPunctLevel) return resultText diff --git a/src/fenrir/core/settings.py b/src/fenrir/core/settings.py index 27bd3916..1b9008cf 100644 --- a/src/fenrir/core/settings.py +++ b/src/fenrir/core/settings.py @@ -60,7 +60,7 @@ settings = { 'highlight': False, }, 'review':{ - 'newLine': True, + 'lineBreak': True, 'endOfScreen': True, }, 'promote':{