Skip to content

Commit c9f7222

Browse files
author
cclauss
authored
ur'string' is Py3 SyntaxError, use u'string' instead
$ python2 ``` $ python2 Python 2.7.13 (default, Jul 18 2017, 09:17:00) [GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> ur"[\w\u2E80-\u9FFF]" == u"[\w\u2E80-\u9FFF]" True >>> ur"[\w\u2E80-\u9FFF]" == r"[\w\u2E80-\u9FFF]" False ```
1 parent 71a80a8 commit c9f7222

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

exts/smallseg.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def cut(self,text):
8686
elif mem2!=None:
8787
delta = mem2[0]-i
8888
if delta>=1:
89-
if (delta<5) and (re.search(ur"[\w\u2E80-\u9FFF]",t)!=None):
89+
if (delta<5) and (re.search(u"[\w\u2E80-\u9FFF]",t)!=None):
9090
pre = text[i-j]
9191
#print pre
9292
if not (pre in self.specialwords):
@@ -141,4 +141,4 @@ def cut(self,text):
141141
recognised.append(text[i-j:i])
142142
else:
143143
recognised.extend(self._pro_unreg(text[i-j:z]))
144-
return recognised
144+
return recognised

0 commit comments

Comments
 (0)