From 208d7757aa9d81ae7dcef1265510023ca5aa1b76 Mon Sep 17 00:00:00 2001 From: Karthikeyan Singaravelan Date: Fri, 17 Apr 2020 14:41:49 +0000 Subject: [PATCH] Fix deprecation warning regarding invalid escape sequences. --- polyglot/text.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyglot/text.py b/polyglot/text.py index 68411a1..55241d5 100644 --- a/polyglot/text.py +++ b/polyglot/text.py @@ -215,7 +215,7 @@ def correct(self): :rtype: :class:`BaseBlob ` """ # regex matches: contraction or word or punctuation or whitespace - tokens = nltk.tokenize.regexp_tokenize(self.raw, "\w*('\w*)+|\w+|[^\w\s]|\s") + tokens = nltk.tokenize.regexp_tokenize(self.raw, r"\w*('\w*)+|\w+|[^\w\s]|\s") corrected = (Word(w).correct() for w in tokens) ret = ''.join(corrected) return self.__class__(ret)