sync with my repo
This commit is contained in:
parent
bd4cbce395
commit
3f0d8ea671
36
src/fenrir/commands/commands/review_next_word_phonetic.py
Normal file
36
src/fenrir/commands/commands/review_next_word_phonetic.py
Normal file
@ -0,0 +1,36 @@
|
||||
#!/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Fenrir TTY screen reader
|
||||
# By Chrys, Storm Dragon, and contributers.
|
||||
|
||||
from core import debug
|
||||
from utils import word_utils
|
||||
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 spells the current word and set review to it'
|
||||
|
||||
def run(self):
|
||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], nextWord = \
|
||||
word_utils.getNextWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
|
||||
if nextWord.isspace():
|
||||
self.env['runtime']['outputManager'].presentText("blank", interrupt=True)
|
||||
else:
|
||||
firstSequence = True
|
||||
for c in nextWord:
|
||||
currChar = char_utils.getPhonetic(c)
|
||||
self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence, announceCapital=True)
|
||||
firstSequence = False
|
||||
|
||||
def setCallback(self, callback):
|
||||
pass
|
36
src/fenrir/commands/commands/review_prev_word_phonetic.py
Normal file
36
src/fenrir/commands/commands/review_prev_word_phonetic.py
Normal file
@ -0,0 +1,36 @@
|
||||
#!/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Fenrir TTY screen reader
|
||||
# By Chrys, Storm Dragon, and contributers.
|
||||
|
||||
from core import debug
|
||||
from utils import word_utils
|
||||
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 spells the current word and set review to it'
|
||||
|
||||
def run(self):
|
||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], prevWord = \
|
||||
word_utils.getPrevWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
|
||||
if prevWord.isspace():
|
||||
self.env['runtime']['outputManager'].presentText("blank", interrupt=True)
|
||||
else:
|
||||
firstSequence = True
|
||||
for c in prevWord:
|
||||
currChar = char_utils.getPhonetic(c)
|
||||
self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence, announceCapital=True)
|
||||
firstSequence = False
|
||||
|
||||
def setCallback(self, callback):
|
||||
pass
|
Loading…
Reference in New Issue
Block a user