[Hejes-devel] [935] added try-except block to suggest call
hejes-devel at nytud.hu
hejes-devel at nytud.hu
Thu Sep 12 11:20:45 CEST 2013
Revision: 935
Author: mittelholcz
Date: 2013-09-12 11:20:45 +0200 (Thu, 12 Sep 2013)
Log Message:
-----------
added try-except block to suggest call
Modified Paths:
--------------
trunk/misc/log/add_output.py
Modified: trunk/misc/log/add_output.py
===================================================================
--- trunk/misc/log/add_output.py 2013-09-11 16:35:23 UTC (rev 934)
+++ trunk/misc/log/add_output.py 2013-09-12 09:20:45 UTC (rev 935)
@@ -50,7 +50,8 @@
if module.endswith('suggest'):
query = unicode(query, 'utf8', 'replace')
start = time()
- answer = spell.union_humor_hunspell(query.split(' '))
+ try: answer = spell.union_humor_hunspell(query.split(' '))
+ except: sys.stderr.write('wrong input: ' + query + '\n')
end = time()
for i in answer:
print(prefix + str(i[0]) + ': ' + ', '.join([ x.encode('utf8') if (type(x)==type(u'')) else str(x) for x in i[1] ]) + '\t' + str(end-start))
More information about the Hejes-devel
mailing list