From ca8728035dc1139988119e216b18b4b131a3d767 Mon Sep 17 00:00:00 2001 From: 4altinok Date: Sun, 11 Feb 2018 18:55:48 +0100 Subject: [PATCH] added new lex feat to token --- spacy/tokens/token.pyx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spacy/tokens/token.pyx b/spacy/tokens/token.pyx index 74487b515..9e4b878cf 100644 --- a/spacy/tokens/token.pyx +++ b/spacy/tokens/token.pyx @@ -15,7 +15,7 @@ from ..lexeme cimport Lexeme from .. import parts_of_speech from ..attrs cimport IS_ALPHA, IS_ASCII, IS_DIGIT, IS_LOWER, IS_PUNCT, IS_SPACE from ..attrs cimport IS_BRACKET, IS_QUOTE, IS_LEFT_PUNCT, IS_RIGHT_PUNCT -from ..attrs cimport IS_OOV, IS_TITLE, IS_UPPER, LIKE_URL, LIKE_NUM, LIKE_EMAIL +from ..attrs cimport IS_OOV, IS_TITLE, IS_UPPER, IS_CURRENCY, LIKE_URL, LIKE_NUM, LIKE_EMAIL from ..attrs cimport IS_STOP, ID, ORTH, NORM, LOWER, SHAPE, PREFIX, SUFFIX from ..attrs cimport LENGTH, CLUSTER, LEMMA, POS, TAG, DEP from ..compat import is_config @@ -855,6 +855,11 @@ cdef class Token: def __get__(self): return Lexeme.c_check_flag(self.c.lex, IS_RIGHT_PUNCT) + property is_currency: + """RETURNS (bool): Whether the token is a currency symbol.""" + def __get__(self): + return Lexeme.c_check_flag(self.c.lex, IS_CURRENCY) + property like_url: """RETURNS (bool): Whether the token resembles a URL.""" def __get__(self):