Subversion Repositories LCARS

Compare Revisions

Last modification

Regard whitespace Rev 295 → Rev 296

/trunk/tools/eazytrans/vuh.py
58,11 → 58,14
def translate (self, phrase, search_prefix=True, search_plural=True):
dictionary = self
 
translation = dictionary.get(phrase.lower(), None)
translation = super().translate(phrase)
if translation is not None:
translation['vuh'] = phrase
return translation
else:
expr_translation = dictionary.translate_expression(phrase)
if expr_translation is not None:
return expr_translation
 
if search_prefix:
# find prefix
for preposition in prepositions:
93,7 → 96,7
cli_help()
exit(1)
 
text = argv[1]
text = ' '.join(argv[1:])
 
dictionary = VulcanDictionary(dictionary)
dictionary.load('vuh-gol-en.dict.zdb.txt', 'vuh')
146,3 → 149,12
offset += 1
 
dmsg("words-translation:", words, min_level=2)
dmsg("words-translation-reduced:",
list(map(
lambda word:
word['en']
if (hasattr(word, "get") and word.get('en', None) is not None)
else word,
words)),
min_level=2)
# dmsg(dictionary._expressions)