diff --git a/components/common_modules/chunks.py b/components/common_modules/chunks.py
index ea4b552..9f58ab5 100644
--- a/components/common_modules/chunks.py
+++ b/components/common_modules/chunks.py
@@ -291,9 +291,8 @@ def _passes_semantics_test(self):
is_event = self._run_classifier(lemma)
logger.debug(" baysian classifier result ==> %s" % is_event)
return is_event
- except bayes.DisambiguationError, (strerror):
- pass
- logger.debug(" DisambiguationError: %s" % unicode(strerror))
+ except bayes.DisambiguationError as e:
+ logger.debug(" DisambiguationError: %s" % e)
# check whether primary sense or some of the senses are events
if EVITA_NOM_WNPRIMSENSE_ONLY:
is_event = wordnet.primarySenseIsEvent(lemma)
diff --git a/components/common_modules/constituent.py b/components/common_modules/constituent.py
index d5f12d3..9588f48 100644
--- a/components/common_modules/constituent.py
+++ b/components/common_modules/constituent.py
@@ -233,7 +233,7 @@ def matchConstituent(self, description):
if self.feature_value(feat) == value[1]:
return False
else:
- raise "ERROR specifying description of pattern"
+ raise Exception("ERROR specifying description of pattern")
elif type(value) is ListType:
if self.feature_value(feat) not in value:
if self.isChunk() and feat == 'text':
diff --git a/components/common_modules/tags.py b/components/common_modules/tags.py
index 60bac62..7e0f14b 100644
--- a/components/common_modules/tags.py
+++ b/components/common_modules/tags.py
@@ -86,7 +86,7 @@ def feature_value(self, name):
logger.warn("Returning 'epos' instead of 'pos' value")
return self.tree.events[self.eid][EPOS]
else:
- raise AttributeError, name
+ raise AttributeError(name)
def _get_attribute(self, name, default):
try:
@@ -127,7 +127,7 @@ def feature_value(self, name):
EVENTID, EIID, CLASS]:
return None
else:
- raise AttributeError, name
+ raise AttributeError(name)
def isTimex(self):
return True
diff --git a/components/common_modules/tokens.py b/components/common_modules/tokens.py
index c7c6be5..c403036 100644
--- a/components/common_modules/tokens.py
+++ b/components/common_modules/tokens.py
@@ -80,7 +80,7 @@ def feature_value(self, name):
EPOS, MOD, POL, EVENTID, EIID, CLASS]:
return None
else:
- raise AttributeError, name
+ raise AttributeError(name)
def getText(self):
"""Return the text of the token."""
@@ -156,7 +156,7 @@ def feature_value(self, name):
return self.tree.events[self.eid].get(POS,'NONE')
return self.tree.events[self.eid][name]
else:
- raise AttributeError, name
+ raise AttributeError(name)
def isAdjToken(self):
return True
diff --git a/components/evita/features.py b/components/evita/features.py
index 81774c2..dfd8d6d 100644
--- a/components/evita/features.py
+++ b/components/evita/features.py
@@ -296,13 +296,13 @@ def is_do_auxiliar(self):
def normalizeMod(self, form):
if form == 'ca': return 'can'
elif form == "'d": return 'would'
- else: raise "ERROR: unknown modal form: "+str(form)
+ else: raise Exception("ERROR: unknown modal form: "+str(form))
def normalizeHave(self, form):
if form == "'d": return 'had'
elif form == "'s": return 'has'
elif form == "'ve": return 'have'
- else: raise "ERROR: unknown raise form: "+str(form)
+ else: raise Exception("ERROR: unknown raise form: "+str(form))
def getPolarity(self):
if self.negative:
diff --git a/components/merging/sputlink/graph.py b/components/merging/sputlink/graph.py
index d008314..57deb3c 100644
--- a/components/merging/sputlink/graph.py
+++ b/components/merging/sputlink/graph.py
@@ -341,28 +341,28 @@ def pp_html(self, filename=None, filehandle=None, standalone=False):
fh = open(filename, 'w') if filename else filehandle
if standalone:
html_graph_prefix(fh)
- fh.write("
\n")
- fh.write("\n")
+ fh.write(u"\n")
+ fh.write(u"\n")
nodes = self.nodes.keys()
nodes.sort(compare_id)
self._html_nodes_table(fh, nodes)
- fh.write(" | \n\n")
- fh.write("\n")
+ fh.write(u" | \n\n")
+ fh.write(u"\n")
self._html_added_table(fh)
- fh.write(" | \n\n")
- fh.write(" \n\n")
+ fh.write(u" |
\n\n")
+ fh.write(u"
\n\n")
if standalone:
- fh.write("