Merge pull request #1891 from fucking-signup/master

Fix issue #1889
This commit is contained in:
Matthew Honnibal 2018-02-18 13:47:47 +01:00 committed by GitHub
commit eb3040ce46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -144,7 +144,7 @@ def is_lower(string): return string.islower()
def is_space(string): return string.isspace()
def is_title(string): return string.istitle()
def is_upper(string): return string.isupper()
def is_stop(string, stops=set()): return string in stops
def is_stop(string, stops=set()): return string.lower() in stops
def is_oov(string): return True
def get_prob(string): return -20.

View File

@ -0,0 +1,11 @@
# coding: utf-8
from __future__ import unicode_literals
from ...lang.lex_attrs import is_stop
from ...lang.en.stop_words import STOP_WORDS
import pytest
@pytest.mark.parametrize('word', ['the'])
def test_lex_attrs_stop_words_case_sensitivity(word):
assert is_stop(word, STOP_WORDS) == is_stop(word.upper(), STOP_WORDS)