mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
* Bug fixes to flag features
This commit is contained in:
parent
bf47429368
commit
8fbe9b6f97
|
@ -15,10 +15,10 @@ def is_digit(string, prob, case_stats, tag_stats):
|
|||
|
||||
def is_punct(string, prob, case_stats, tag_stats):
|
||||
for c in string:
|
||||
if unicodedata.category(unichr(c)).startswith('P'):
|
||||
return True
|
||||
if not unicodedata.category(c).startswith('P'):
|
||||
return False
|
||||
else:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def is_space(string, prob, case_stats, tag_stats):
|
||||
|
@ -27,7 +27,7 @@ def is_space(string, prob, case_stats, tag_stats):
|
|||
|
||||
def is_ascii(string, prob, case_stats, tag_stats):
|
||||
for c in string:
|
||||
if unichr(c) >= 128:
|
||||
if ord(c) >= 128:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
|
Loading…
Reference in New Issue
Block a user