From 9bc524982e33bb9bc8dcd881ce5cff5f3f54eae4 Mon Sep 17 00:00:00 2001 From: Kit Date: Mon, 8 Jan 2018 03:25:08 +0100 Subject: [PATCH] Find lowercased forms of numeric words --- spacy/lang/da/lex_attrs.py | 4 ++-- spacy/lang/en/lex_attrs.py | 2 +- spacy/lang/fr/lex_attrs.py | 2 +- spacy/lang/id/lex_attrs.py | 2 +- spacy/lang/nl/lex_attrs.py | 2 +- spacy/lang/pt/lex_attrs.py | 2 +- spacy/lang/ru/lex_attrs.py | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spacy/lang/da/lex_attrs.py b/spacy/lang/da/lex_attrs.py index 8152ad259..ec60c5132 100644 --- a/spacy/lang/da/lex_attrs.py +++ b/spacy/lang/da/lex_attrs.py @@ -41,9 +41,9 @@ def like_num(text): num, denom = text.split('/') if num.isdigit() and denom.isdigit(): return True - if text in _num_words: + if text.lower() in _num_words: return True - if text in _ordinal_words: + if text.lower() in _ordinal_words: return True return False diff --git a/spacy/lang/en/lex_attrs.py b/spacy/lang/en/lex_attrs.py index 471f61977..5af136449 100644 --- a/spacy/lang/en/lex_attrs.py +++ b/spacy/lang/en/lex_attrs.py @@ -20,7 +20,7 @@ def like_num(text): num, denom = text.split('/') if num.isdigit() and denom.isdigit(): return True - if text in _num_words: + if text.lower() in _num_words: return True return False diff --git a/spacy/lang/fr/lex_attrs.py b/spacy/lang/fr/lex_attrs.py index 41c509dff..faffd7fa2 100644 --- a/spacy/lang/fr/lex_attrs.py +++ b/spacy/lang/fr/lex_attrs.py @@ -31,7 +31,7 @@ def like_num(text): num, denom = text.split('/') if num.isdigit() and denom.isdigit(): return True - if text in _num_words: + if text.lower() in _num_words: return True return False diff --git a/spacy/lang/id/lex_attrs.py b/spacy/lang/id/lex_attrs.py index fb6a31f99..235cee438 100644 --- a/spacy/lang/id/lex_attrs.py +++ b/spacy/lang/id/lex_attrs.py @@ -27,7 +27,7 @@ def like_num(text): num, denom = text.split('/') if num.isdigit() and denom.isdigit(): return True - if text in _num_words: + if text.lower() in _num_words: return True if text.count('-') == 1: _, num = text.split('-') diff --git a/spacy/lang/nl/lex_attrs.py b/spacy/lang/nl/lex_attrs.py index 08b1df3be..ee38c45bc 100644 --- a/spacy/lang/nl/lex_attrs.py +++ b/spacy/lang/nl/lex_attrs.py @@ -30,7 +30,7 @@ def like_num(text): num, denom = text.split('/') if num.isdigit() and denom.isdigit(): return True - if text in _num_words: + if text.lower() in _num_words: return True return False diff --git a/spacy/lang/pt/lex_attrs.py b/spacy/lang/pt/lex_attrs.py index fa80cde73..ce79b7d91 100644 --- a/spacy/lang/pt/lex_attrs.py +++ b/spacy/lang/pt/lex_attrs.py @@ -28,7 +28,7 @@ def like_num(text): num, denom = text.split('/') if num.isdigit() and denom.isdigit(): return True - if text in _num_words: + if text.lower() in _num_words: return True return False diff --git a/spacy/lang/ru/lex_attrs.py b/spacy/lang/ru/lex_attrs.py index e44525743..27ae76326 100644 --- a/spacy/lang/ru/lex_attrs.py +++ b/spacy/lang/ru/lex_attrs.py @@ -25,7 +25,7 @@ def like_num(text): num, denom = text.split('/') if num.isdigit() and denom.isdigit(): return True - if text in _num_words: + if text.lower() in _num_words: return True return False