mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-10 08:12:24 +03:00
implement all comparison operators for inf int
This commit is contained in:
parent
02d8d62053
commit
fe4c094d86
|
@ -152,6 +152,15 @@ class _MaxInt(int):
|
|||
def __le__(self, other):
|
||||
return False
|
||||
|
||||
def __lt__(self, other):
|
||||
return False
|
||||
|
||||
def __ge__(self, other):
|
||||
return True
|
||||
|
||||
def __gt__(self, other):
|
||||
return True
|
||||
|
||||
|
||||
class SpanFinder(TrainablePipe):
|
||||
"""Pipeline that learns span boundaries"""
|
||||
|
@ -192,7 +201,6 @@ class SpanFinder(TrainablePipe):
|
|||
max_length = _MaxInt()
|
||||
if min_length is None:
|
||||
min_length = 1
|
||||
|
||||
if max_length < 1 or min_length < 1:
|
||||
raise ValueError(
|
||||
Errors.E1052.format(min_length=min_length, max_length=max_length)
|
||||
|
|
Loading…
Reference in New Issue
Block a user