mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 00:46:28 +03:00
added lex test for is_currency
This commit is contained in:
parent
c63e99da8a
commit
471d3c9e23
|
@ -2,7 +2,7 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from ...attrs import intify_attrs, ORTH, NORM, LEMMA, IS_ALPHA
|
||||
from ...lang.lex_attrs import is_punct, is_ascii, like_url, word_shape
|
||||
from ...lang.lex_attrs import is_punct, is_ascii, is_currency, like_url, word_shape
|
||||
|
||||
import pytest
|
||||
|
||||
|
@ -37,6 +37,13 @@ def test_lex_attrs_is_ascii(text, match):
|
|||
assert is_ascii(text) == match
|
||||
|
||||
|
||||
@pytest.mark.parametrize('text,match', [('$', True), ('£', True), ('♥', False),
|
||||
('€', True), ('¥', True), ('¢', True),
|
||||
('a', False), ('www.google.com', False), ('dog', False)])
|
||||
def test_lex_attrs_is_currency(text, match):
|
||||
assert is_currency(text) == match
|
||||
|
||||
|
||||
@pytest.mark.parametrize('text,match', [
|
||||
('www.google.com', True), ('google.com', True), ('sydney.com', True),
|
||||
('2girls1cup.org', True), ('http://stupid', True), ('www.hi', True),
|
||||
|
|
Loading…
Reference in New Issue
Block a user