[Hejes-devel] [1502] Bugfix: exception from Humor for rubeola etc.
hejes-devel at nytud.hu
hejes-devel at nytud.hu
Wed Sep 30 16:44:14 CEST 2015
Revision: 1502
Author: mihaltz
Date: 2015-09-30 16:44:14 +0200 (Wed, 30 Sep 2015)
Log Message:
-----------
Bugfix: exception from Humor for rubeola etc.
Modified Paths:
--------------
trunk/web2py/applications/helyesiras_webdev/modules/egybekulon2_humor.py
trunk/web2py/applications/helyesiras_webdev/modules/egybekulon2_input.py
Modified: trunk/web2py/applications/helyesiras_webdev/modules/egybekulon2_humor.py
===================================================================
--- trunk/web2py/applications/helyesiras_webdev/modules/egybekulon2_humor.py 2015-09-30 14:09:20 UTC (rev 1501)
+++ trunk/web2py/applications/helyesiras_webdev/modules/egybekulon2_humor.py 2015-09-30 14:44:14 UTC (rev 1502)
@@ -252,8 +252,10 @@
# get stem and final PoS
m = re.match('^([^\[\]]+)\[([^\[\]]+)\]$', t[0])
if not m:
- raise Exception('Error parsing humor output: no stem[pos]: "{0}"'.format(line))
- stem, pos = m.group(1, 2)
+ sys.stderr.write('Warning, parsing humor output: no stem[pos]: "{0}"\n'.format(line))
+ stem, pos = '?', '?'
+ else:
+ stem, pos = m.group(1, 2)
# get morphs
morphs = []
if lex7:
Modified: trunk/web2py/applications/helyesiras_webdev/modules/egybekulon2_input.py
===================================================================
--- trunk/web2py/applications/helyesiras_webdev/modules/egybekulon2_input.py 2015-09-30 14:09:20 UTC (rev 1501)
+++ trunk/web2py/applications/helyesiras_webdev/modules/egybekulon2_input.py 2015-09-30 14:44:14 UTC (rev 1502)
@@ -79,7 +79,8 @@
# for each category to be generated
cats = HUMORPOS_TO_GRMCAT.get(ana.pos, None)
if cats == None:
- raise Exception('Unknown PoS in POS2CAT when generating a Node: {0}'.format(ana.pos))
+ sys.stderr.write('Warning, unknown PoS in POS2CAT when generating a Node: "{0}"\n'.format(ana.pos))
+ continue # skip this ana
for cat in cats:
# create a new Node object
node = Node()
More information about the Hejes-devel
mailing list