24 from english_support
import *
25 from greek_support
import *
38 super(GreekEnglishSupport, self).
__init__()
63 english_sentences = []
69 if re.match(
'[a-zA-Z\-]', word):
70 RappUtilities.rapp_print(
"English word: " + str(word) )
71 english_words.append( word )
73 RappUtilities.rapp_print(
"Greek word: " + str(word) )
74 greek_words.append( word )
77 if re.match(
'[a-zA-Z\-]', word):
78 RappUtilities.rapp_print(
"English grammar: " + str(word) )
79 english_grammar.append( word )
81 RappUtilities.rapp_print(
"Greek grammar: " + str(word) )
82 greek_grammar.append( word )
84 for word
in sentences:
85 if re.match(
'[a-zA-Z\-]', word):
86 RappUtilities.rapp_print(
"English sentence: " + str(word) )
87 english_sentences.append( word )
89 RappUtilities.rapp_print(
"Greek sentence: " + str(word) )
90 greek_sentences.append( word )
92 return [ english_words, english_grammar, english_sentences, greek_words, \
93 greek_grammar, greek_sentences ]
106 [ english_words, english_grammar, english_sentences, \
107 greek_words, greek_grammar, greek_sentences ] = \
111 [englified_phonems_dict, englified_to_greek_dict] = \
115 for word
in english_words:
116 englified_to_greek_dict.update( {word: word} )
119 english_phonem_dict = self._english_support.getWordPhonemes( english_words )
127 final_phoneme_dict = english_phonem_dict
128 final_phoneme_dict.update(englified_phonems_dict)
129 final_sentences = englified_sentences + english_sentences
130 final_grammar = english_grammar + englified_grammar
133 limited_sphinx_configuration = \
134 self._vocabulary.createConfigurationFiles( \
135 final_phoneme_dict, final_grammar, final_sentences \
137 except RappError
as e:
138 raise RappError(e.value)
140 return [limited_sphinx_configuration, englified_to_greek_dict]
def getLimitedVocebularyConfiguration
Computes the Limited Greek/English Configuration.
def _separateEngGrWords
Separates English from Greek words.
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 English Sphinx speech recognition. ...
def _transformWords
Transforms the Greek words into phonemes for the Sphinx configuration.