From 401045433c3c2ab9957af97914a4f9ebb0949055 Mon Sep 17 00:00:00 2001 From: ines Date: Sun, 23 Apr 2017 21:05:39 +0200 Subject: [PATCH] Simplify compat.fix_text --- spacy/compat.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spacy/compat.py b/spacy/compat.py index 8458df7b0..1ca8a59fe 100644 --- a/spacy/compat.py +++ b/spacy/compat.py @@ -23,6 +23,8 @@ is_windows = sys.platform.startswith('win') is_linux = sys.platform.startswith('linux') is_osx = sys.platform == 'darwin' +fix_text = ftfy.fix_text + if is_python2: bytes_ = str @@ -39,9 +41,6 @@ elif is_python3: json_dumps = lambda data: ujson.dumps(data, indent=2) -fix_text = lambda text: ftfy.fix_text(text) - - def symlink_to(orig, dest): if is_python2 and is_windows: import subprocess