mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-13 10:46:29 +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):
|
def is_punct(string, prob, case_stats, tag_stats):
|
||||||
for c in string:
|
for c in string:
|
||||||
if unicodedata.category(unichr(c)).startswith('P'):
|
if not unicodedata.category(c).startswith('P'):
|
||||||
return True
|
|
||||||
else:
|
|
||||||
return False
|
return False
|
||||||
|
else:
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def is_space(string, prob, case_stats, tag_stats):
|
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):
|
def is_ascii(string, prob, case_stats, tag_stats):
|
||||||
for c in string:
|
for c in string:
|
||||||
if unichr(c) >= 128:
|
if ord(c) >= 128:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue
Block a user