@@ -89,7 +89,7 @@ def compile_pattern(elements):
8989 else :
9090 # assume string or string like object
9191 elements = elements .split (',' )
92- return re .compile ('|' .join ([re .escape (x .lower ()) for x in elements ]), re .U )
92+ return re .compile (u '|' .join ([re .escape (x .lower ()) for x in elements ]), re .U )
9393
9494class Document :
9595 """Class to build a etree document out of html."""
@@ -207,7 +207,7 @@ def summary(self, html_partial=False):
207207 # code never runs) which would require write this line as:
208208 # write this line as
209209 # Unparseable(str(e))
210- # but then we loose the traceback information. 3.4 on the
210+ # but then we lose the traceback information. 3.4 on the
211211 # other hand accepts the old syntax and would only complain
212212 # at runtime.
213213 raise Unparseable (str (e )), None , sys .exc_info ()[2 ]
@@ -262,7 +262,7 @@ def get_article(self, candidates, best_candidate, html_partial=False):
262262 return output
263263
264264 def select_best_candidate (self , candidates ):
265- sorted_candidates = sorted (list ( candidates .values () ), key = lambda x : x ['content_score' ], reverse = True )
265+ sorted_candidates = sorted (candidates .values (), key = lambda x : x ['content_score' ], reverse = True )
266266 for candidate in sorted_candidates [:5 ]:
267267 elem = candidate ['elem' ]
268268 self .debug ("Top 5 : %6.3f %s" % (
0 commit comments