Subversion Repositories LCARS

Compare Revisions

Last modification

Regard whitespace Rev 296 → Rev 295

/trunk/tools/eazytrans/vuh.py
58,14 → 58,11
def translate (self, phrase, search_prefix=True, search_plural=True):
dictionary = self
 
translation = super().translate(phrase)
translation = dictionary.get(phrase.lower(), None)
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:
96,7 → 93,7
cli_help()
exit(1)
 
text = ' '.join(argv[1:])
text = argv[1]
 
dictionary = VulcanDictionary(dictionary)
dictionary.load('vuh-gol-en.dict.zdb.txt', 'vuh')
149,12 → 146,3
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)