add next/pref char phoneteic
This commit is contained in:
@ -15,19 +15,19 @@ class command():
|
||||
def shutdown(self):
|
||||
pass
|
||||
def getDescription(self):
|
||||
return 'phonetically presents the current character'
|
||||
return 'set review and phonetically presents the current character'
|
||||
|
||||
def run(self):
|
||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||
|
||||
x, y, currChar = \
|
||||
char_utils.getCurrentChar(cursorPos['x'], cursorPos['y'], self.env['screenData']['newContentText'])
|
||||
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:
|
||||
currChar = char_utils.getPhonetic(currChar)
|
||||
self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True)
|
||||
self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, announceCapital=True)
|
||||
|
||||
def setCallback(self, callback):
|
||||
pass
|
@ -19,9 +19,9 @@ class command():
|
||||
return 'phonetically spells the current word'
|
||||
|
||||
def run(self):
|
||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||
x, y, currWord = \
|
||||
word_utils.getCurrentWord(cursorPos['x'], cursorPos['y'], self.env['screenData']['newContentText'])
|
||||
word_utils.getCurrentWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
|
||||
if currWord.isspace():
|
||||
self.env['runtime']['outputManager'].presentText("blank", interrupt=True)
|
@ -18,10 +18,7 @@ class command():
|
||||
return 'moves review to the next character and presents it'
|
||||
|
||||
def run(self):
|
||||
self.env['screenData']['oldCursorReview'] = self.env['screenData']['newCursorReview']
|
||||
if not self.env['screenData']['newCursorReview']:
|
||||
self.env['screenData']['newCursorReview'] = self.env['screenData']['newCursor'].copy()
|
||||
|
||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||
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'])
|
||||
|
||||
|
33
src/fenrir/commands/commands/review_next_char_phonetic.py
Normal file
33
src/fenrir/commands/commands/review_next_char_phonetic.py
Normal file
@ -0,0 +1,33 @@
|
||||
#!/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Fenrir TTY screen reader
|
||||
# By Chrys, Storm Dragon, and contributers.
|
||||
|
||||
from core import debug
|
||||
from utils import char_utils
|
||||
|
||||
class command():
|
||||
def __init__(self):
|
||||
pass
|
||||
def initialize(self, environment):
|
||||
self.env = environment
|
||||
def shutdown(self):
|
||||
pass
|
||||
def getDescription(self):
|
||||
return 'phonetically presents the next character and set review to it'
|
||||
|
||||
def run(self):
|
||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], nextChar = \
|
||||
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)
|
||||
|
||||
def setCallback(self, callback):
|
||||
pass
|
33
src/fenrir/commands/commands/review_prev_char_phonetic.py
Normal file
33
src/fenrir/commands/commands/review_prev_char_phonetic.py
Normal file
@ -0,0 +1,33 @@
|
||||
#!/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Fenrir TTY screen reader
|
||||
# By Chrys, Storm Dragon, and contributers.
|
||||
|
||||
from core import debug
|
||||
from utils import char_utils
|
||||
|
||||
class command():
|
||||
def __init__(self):
|
||||
pass
|
||||
def initialize(self, environment):
|
||||
self.env = environment
|
||||
def shutdown(self):
|
||||
pass
|
||||
def getDescription(self):
|
||||
return 'phonetically presents the previous character and set review to it'
|
||||
|
||||
def run(self):
|
||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], nextChar = \
|
||||
char_utils.getPrevChar(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)
|
||||
|
||||
def setCallback(self, callback):
|
||||
pass
|
Reference in New Issue
Block a user