diff --git a/requirements.txt b/requirements.txt index bf10a1165..acbf3a3b1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ pathlib preshed == 0.41 thinc == 3.3 murmurhash == 0.24 -unidecode +text-unidecode numpy wget plac diff --git a/spacy/orth.pyx b/spacy/orth.pyx index df4e2dc32..27123bb4e 100644 --- a/spacy/orth.pyx +++ b/spacy/orth.pyx @@ -1,7 +1,16 @@ # -*- coding: utf8 -*- from __future__ import unicode_literals import unicodedata -from unidecode import unidecode + +# If your license is not GPL compatible, use text_unidecode. But if your code +# is, you should use the unidecode library, because its performance is better. +# spaCy does not list unidecode as a dependency, in case your license is not +# GPL compatible. +try: + from unidecode import unidecode +except ImportError: + from text_unidecode import unidecode + import re import math