22 from language_support
import *
23 from english_support
import *
71 f_base_pre = [
u'π',
u'τ',
u'κ',
u'θ',
u'χ',
u'σ',
u'ξ',
u'ψ']
74 f_base.append(l.encode(
'utf-8'))
76 v_base_pre = [
u'δ',
u'γ',
u'ζ',
u'λ',
u'ρ',
u'μ',
u'ν',
u'α',
u'ά',
u'ε',\
77 u'έ',
u'η',
u'ή',
u'ι',
u'ί',
u'ϊ',
u'ΐ',
u'ο',
u'ό',
u'υ',
u'ύ',
u'ϋ'\
81 v_base.append(l.encode(
'utf-8'))
117 self.
_phonemes[(
u'ου').encode(
'utf-8')] =
'UW '
118 self.
_phonemes[(
u'ού').encode(
'utf-8')] =
'UW '
119 self.
_phonemes[(
u'μπ').encode(
'utf-8')] =
'B '
120 self.
_phonemes[(
u'ντ').encode(
'utf-8')] =
'D '
121 self.
_phonemes[(
u'γκ').encode(
'utf-8')] =
'G '
122 self.
_phonemes[(
u'γγ').encode(
'utf-8')] =
'G '
123 self.
_phonemes[(
u'τσ').encode(
'utf-8')] =
'CH '
124 self.
_phonemes[(
u'τζ').encode(
'utf-8')] =
'JH '
125 self.
_phonemes[(
u'σσ').encode(
'utf-8')] =
'S '
126 self.
_phonemes[(
u'κκ').encode(
'utf-8')] =
'K '
127 self.
_phonemes[(
u'ββ').encode(
'utf-8')] =
'V '
128 self.
_phonemes[(
u'λλ').encode(
'utf-8')] =
'L '
129 self.
_phonemes[(
u'μμ').encode(
'utf-8')] =
'M '
130 self.
_phonemes[(
u'νν').encode(
'utf-8')] =
'N '
131 self.
_phonemes[(
u'ππ').encode(
'utf-8')] =
'P '
132 self.
_phonemes[(
u'ρρ').encode(
'utf-8')] =
'R '
133 self.
_phonemes[(
u'ττ').encode(
'utf-8')] =
'T '
144 self._special_two_digit_letters.append((
u'αυ').encode(
'utf-8'))
145 self._special_two_digit_letters.append((
u'αύ').encode(
'utf-8'))
146 self._special_two_digit_letters.append((
u'ευ').encode(
'utf-8'))
147 self._special_two_digit_letters.append((
u'εύ').encode(
'utf-8'))
148 special_two_digit_letters_v = {}
149 special_two_digit_letters_v[(
u'αυ').encode(
'utf-8')] = (
u'αβ').encode(
'utf-8')
150 special_two_digit_letters_v[(
u'αύ').encode(
'utf-8')] = (
u'άβ').encode(
'utf-8')
151 special_two_digit_letters_v[(
u'ευ').encode(
'utf-8')] = (
u'εβ').encode(
'utf-8')
152 special_two_digit_letters_v[(
u'εύ').encode(
'utf-8')] = (
u'έβ').encode(
'utf-8')
153 special_two_digit_letters_f = {}
154 special_two_digit_letters_f[(
u'αυ').encode(
'utf-8')] = (
u'αφ').encode(
'utf-8')
155 special_two_digit_letters_f[(
u'αύ').encode(
'utf-8')] = (
u'άφ').encode(
'utf-8')
156 special_two_digit_letters_f[(
u'ευ').encode(
'utf-8')] = (
u'εφ').encode(
'utf-8')
157 special_two_digit_letters_f[(
u'εύ').encode(
'utf-8')] = (
u'έφ').encode(
'utf-8')
162 special_two_digit_letters_f[tdl] + fb
166 special_two_digit_letters_v[tdl] + vb
178 self.
_letters[(
u'α').encode(
'utf-8')] =
'AA '
179 self.
_letters[(
u'ά').encode(
'utf-8')] =
'AA '
180 self.
_letters[(
u'β').encode(
'utf-8')] =
'V '
181 self.
_letters[(
u'γ').encode(
'utf-8')] =
'W '
182 self.
_letters[(
u'δ').encode(
'utf-8')] =
'DH '
183 self.
_letters[(
u'ε').encode(
'utf-8')] =
'EH '
184 self.
_letters[(
u'έ').encode(
'utf-8')] =
'EH '
185 self.
_letters[(
u'ζ').encode(
'utf-8')] =
'Z '
186 self.
_letters[(
u'η').encode(
'utf-8')] =
'IH '
187 self.
_letters[(
u'ή').encode(
'utf-8')] =
'IH '
188 self.
_letters[(
u'θ').encode(
'utf-8')] =
'TH '
189 self.
_letters[(
u'ι').encode(
'utf-8')] =
'IH '
190 self.
_letters[(
u'ί').encode(
'utf-8')] =
'IH '
191 self.
_letters[(
u'ϊ').encode(
'utf-8')] =
'IH '
192 self.
_letters[(
u'ΐ').encode(
'utf-8')] =
'IH '
193 self.
_letters[(
u'κ').encode(
'utf-8')] =
'K '
194 self.
_letters[(
u'λ').encode(
'utf-8')] =
'L '
195 self.
_letters[(
u'μ').encode(
'utf-8')] =
'M '
196 self.
_letters[(
u'ν').encode(
'utf-8')] =
'N '
197 self.
_letters[(
u'ξ').encode(
'utf-8')] =
'K S '
198 self.
_letters[(
u'ο').encode(
'utf-8')] =
'OW '
199 self.
_letters[(
u'ό').encode(
'utf-8')] =
'OW '
200 self.
_letters[(
u'π').encode(
'utf-8')] =
'P '
201 self.
_letters[(
u'ρ').encode(
'utf-8')] =
'R '
202 self.
_letters[(
u'σ').encode(
'utf-8')] =
'S '
203 self.
_letters[(
u'τ').encode(
'utf-8')] =
'T '
204 self.
_letters[(
u'υ').encode(
'utf-8')] =
'IH '
205 self.
_letters[(
u'ύ').encode(
'utf-8')] =
'IH '
206 self.
_letters[(
u'ϋ').encode(
'utf-8')] =
'IH '
207 self.
_letters[(
u'ΰ').encode(
'utf-8')] =
'IH '
208 self.
_letters[(
u'φ').encode(
'utf-8')] =
'F '
209 self.
_letters[(
u'χ').encode(
'utf-8')] =
'HH '
210 self.
_letters[(
u'ψ').encode(
'utf-8')] =
'P S '
211 self.
_letters[(
u'ω').encode(
'utf-8')] =
'OW '
212 self.
_letters[(
u'ώ').encode(
'utf-8')] =
'OW '
213 self.
_letters[(
u'ς').encode(
'utf-8')] =
'S '
264 RappUtilities.rapp_print (
"Initial word: " + initial_word)
268 RappUtilities.rapp_print (
"Caps to small: " + initial_word)
273 englified_words[eng_w] = word
274 RappUtilities.rapp_print (
"Englified: " + eng_w)
277 initial_word = initial_word.replace(ph, self.
_phonemes[ph])
278 RappUtilities.rapp_print (
"Phonemes: " + initial_word)
281 initial_word = initial_word.replace(stdl, \
283 RappUtilities.rapp_print (
"Special 2 digit letters: " + initial_word)
287 RappUtilities.rapp_print (
"2 digit letters: " + initial_word)
291 RappUtilities.rapp_print (
"specific rules: " + initial_word)
294 initial_word = initial_word.replace(l, self.
_letters[l])
295 RappUtilities.rapp_print (
"rest of letters: " + initial_word)
297 enhanced_words[eng_w] = []
298 temp = initial_word.split(
' ')
301 enhanced_words[eng_w] = temp
303 return [enhanced_words, englified_words]
317 englified_words.append(eng_w)
318 return englified_words
332 [englified_phonemes_dict, englified_to_greek_dict] = \
340 limited_sphinx_configuration = \
341 self._vocabulary.createConfigurationFiles( \
342 englified_phonemes_dict, englified_grammar, englified_sentences \
344 except RappError
as e:
345 raise RappError(e.value)
347 return [limited_sphinx_configuration, englified_to_greek_dict]
def _configureLetters
Creates the basic Greek letter to English configuration.
_special_two_digit_letters
Special two digit Greek letter->English phonemes mapping.
_literal_letters
Greek letters->English letters mapping.
def getLimitedVocebularyConfiguration
Computes the Limited Greek Configuration.
_all_special_two_digit_letters
All special two digit Greek letter->English phonemes mapping.
_s_specific_rules
Special Greek words ->English phonemes mapping.
def _englify_words
Englify Greek words.
def __init__
Performs initializations.
Allows the creation of configuration files for Greek Sphinx speech recognition.
Allows the creation of configuration files for Sphinx speech recognition.
_two_digit_letters
Two digit Greek letters->English phonemes mapping.
_letters
Standard Greek letter->English phonemes mapping.
_capital_letters
Greek uppercase to lowercase mapping.
Allows the creation of configuration files for English Sphinx speech recognition. ...
def _transformWords
Transforms the Greek words into phonemes for the Sphinx configuration.
_phonemes
Greek words->English standard phonemes mapping.
_english_support
Allows the creation of configuration files for English words.