From d7898d586f6186459f3e8b4c016a78872fd159bc Mon Sep 17 00:00:00 2001 From: ines Date: Wed, 15 Mar 2017 17:35:41 +0100 Subject: [PATCH] Fix formatting and remove unused code --- spacy/util.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/spacy/util.py b/spacy/util.py index dd1ae1b3b..0ed69aadc 100644 --- a/spacy/util.py +++ b/spacy/util.py @@ -6,10 +6,10 @@ import json import re import os.path import pathlib - import six from .attrs import TAG, HEAD, DEP, ENT_IOB, ENT_TYPE + try: basestring except NameError: @@ -74,20 +74,6 @@ def split_data_name(name): return name.split('-', 1) if '-' in name else (name, '') -def constraint_match(constraint_string, version): - # From http://github.com/spacy-io/sputnik - if not constraint_string: - return True - - constraints = [c.strip() for c in constraint_string.split(',') if c.strip()] - - for c in constraints: - if not re.match(r'[><=][=]?\d+(\.\d+)*', c): - raise ValueError('invalid constraint: %s' % c) - - return all(semver.match(version, c) for c in constraints) - - def read_regex(path): path = path if not isinstance(path, basestring) else pathlib.Path(path) with path.open() as file_: