From a45a01ed8ff48deef3ef4c3e4a01ec4dec493d06 Mon Sep 17 00:00:00 2001 From: Olivier Grisel <olivier.grisel@ensta.org> Date: Mon, 5 Jul 2010 10:43:31 +0200 Subject: [PATCH] use compiled re pattern --- scikits/learn/features/text.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scikits/learn/features/text.py b/scikits/learn/features/text.py index e77a5f842a..785ea443d0 100644 --- a/scikits/learn/features/text.py +++ b/scikits/learn/features/text.py @@ -35,7 +35,7 @@ class SimpleAnalyzer(object): if isinstance(text_document, str): text_document = text_document.decode(self.charset, 'ignore') text_document = strip_accents(text_document.lower()) - return re.findall(self.token_pattern, text_document) + return self.token_pattern.findall(text_document) class HashingVectorizer(object): -- GitLab