mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 18:06:29 +03:00
Use logger.warning instead of logger.warn (#6596)
Use `logger.warning` instead of deprecated `logger.warn`.
This commit is contained in:
parent
282a3b49ea
commit
cabd4ae5b1
|
@ -198,7 +198,7 @@ class Lemmatizer(Pipe):
|
||||||
univ_pos = token.pos_.lower()
|
univ_pos = token.pos_.lower()
|
||||||
if univ_pos in ("", "eol", "space"):
|
if univ_pos in ("", "eol", "space"):
|
||||||
if univ_pos == "":
|
if univ_pos == "":
|
||||||
logger.warn(Warnings.W108.format(text=string))
|
logger.warning(Warnings.W108.format(text=string))
|
||||||
return [string.lower()]
|
return [string.lower()]
|
||||||
# See Issue #435 for example of where this logic is requied.
|
# See Issue #435 for example of where this logic is requied.
|
||||||
if self.is_base_form(token):
|
if self.is_base_form(token):
|
||||||
|
|
|
@ -59,9 +59,9 @@ def test_lemmatizer_config(nlp):
|
||||||
# warning if no POS assigned
|
# warning if no POS assigned
|
||||||
doc = nlp.make_doc("coping")
|
doc = nlp.make_doc("coping")
|
||||||
logger = logging.getLogger("spacy")
|
logger = logging.getLogger("spacy")
|
||||||
with mock.patch.object(logger, "warn") as mock_warn:
|
with mock.patch.object(logger, "warning") as mock_warning:
|
||||||
doc = lemmatizer(doc)
|
doc = lemmatizer(doc)
|
||||||
mock_warn.assert_called_once()
|
mock_warning.assert_called_once()
|
||||||
|
|
||||||
# works with POS
|
# works with POS
|
||||||
doc = nlp.make_doc("coping")
|
doc = nlp.make_doc("coping")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user