mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-26 01:04:34 +03:00
Find lowercased forms of numeric words
This commit is contained in:
parent
dba6adea65
commit
9bc524982e
|
@ -41,9 +41,9 @@ def like_num(text):
|
||||||
num, denom = text.split('/')
|
num, denom = text.split('/')
|
||||||
if num.isdigit() and denom.isdigit():
|
if num.isdigit() and denom.isdigit():
|
||||||
return True
|
return True
|
||||||
if text in _num_words:
|
if text.lower() in _num_words:
|
||||||
return True
|
return True
|
||||||
if text in _ordinal_words:
|
if text.lower() in _ordinal_words:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ def like_num(text):
|
||||||
num, denom = text.split('/')
|
num, denom = text.split('/')
|
||||||
if num.isdigit() and denom.isdigit():
|
if num.isdigit() and denom.isdigit():
|
||||||
return True
|
return True
|
||||||
if text in _num_words:
|
if text.lower() in _num_words:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ def like_num(text):
|
||||||
num, denom = text.split('/')
|
num, denom = text.split('/')
|
||||||
if num.isdigit() and denom.isdigit():
|
if num.isdigit() and denom.isdigit():
|
||||||
return True
|
return True
|
||||||
if text in _num_words:
|
if text.lower() in _num_words:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ def like_num(text):
|
||||||
num, denom = text.split('/')
|
num, denom = text.split('/')
|
||||||
if num.isdigit() and denom.isdigit():
|
if num.isdigit() and denom.isdigit():
|
||||||
return True
|
return True
|
||||||
if text in _num_words:
|
if text.lower() in _num_words:
|
||||||
return True
|
return True
|
||||||
if text.count('-') == 1:
|
if text.count('-') == 1:
|
||||||
_, num = text.split('-')
|
_, num = text.split('-')
|
||||||
|
|
|
@ -30,7 +30,7 @@ def like_num(text):
|
||||||
num, denom = text.split('/')
|
num, denom = text.split('/')
|
||||||
if num.isdigit() and denom.isdigit():
|
if num.isdigit() and denom.isdigit():
|
||||||
return True
|
return True
|
||||||
if text in _num_words:
|
if text.lower() in _num_words:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ def like_num(text):
|
||||||
num, denom = text.split('/')
|
num, denom = text.split('/')
|
||||||
if num.isdigit() and denom.isdigit():
|
if num.isdigit() and denom.isdigit():
|
||||||
return True
|
return True
|
||||||
if text in _num_words:
|
if text.lower() in _num_words:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ def like_num(text):
|
||||||
num, denom = text.split('/')
|
num, denom = text.split('/')
|
||||||
if num.isdigit() and denom.isdigit():
|
if num.isdigit() and denom.isdigit():
|
||||||
return True
|
return True
|
||||||
if text in _num_words:
|
if text.lower() in _num_words:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user