remove compounds_with methods and attributes
@@ -68,10 +68,6 @@ class SimplePredicate(Predicate):
else:
return ()
- def compounds_with(self, other):
-
- return True
-
class StringPredicate(SimplePredicate):
def __call__(self, record: RecordDict, **kwargs):
@@ -81,15 +77,6 @@ class StringPredicate(SimplePredicate):
else:
return ()
- def compounds_with(self, other):
-
- if other.field == self.field:
- return getattr(self.func,
- 'compounds_with_same_field',
- True)
-
- return True
-
class ExistsPredicate(Predicate):
type = "ExistsPredicate"
@@ -97,7 +84,6 @@ class ExistsPredicate(Predicate):
def __init__(self, field):
self.__name__ = "(Exists, %s)" % (field,)
self.field = field
- self.compounds_with_same_field = False
@staticmethod
def func(column):
@@ -110,13 +96,6 @@ class ExistsPredicate(Predicate):
column = record[self.field]
return self.func(column)
- def compounds_with(self, other):
-
- if self.field == other.field:
- return False
-
- return True
-
class IndexPredicate(Predicate):
def __init__(self, threshold, field):
@@ -124,7 +103,6 @@ class IndexPredicate(Predicate):
self.field = field
self.threshold = threshold
self.index = None
- self.compounds_with_same_field = False
def __getstate__(self):
odict = self.__dict__.copy()
@@ -138,14 +116,6 @@ class IndexPredicate(Predicate):
if not hasattr(self, 'index'):
self.index = None
- def compounds_with(self, other):
-
- if other.field == self.field:
- if type(other) == type(self):
- return False
-
- return True
-
def reset(self):
...
@@ -347,9 +317,6 @@ def wholeFieldPredicate(field: Any) -> Tuple[str]:
return (str(field), )
-wholeFieldPredicate.compounds_with_same_field = False # type: ignore
-
-
def tokenFieldPredicate(field):
"""returns the tokens"""
return set(words(field))
@@ -466,9 +433,6 @@ def suffixArray(field):
yield field[i:]
-suffixArray.compounds_with_same_field = False # type: ignore
-
-
def sortedAcronym(field: str) -> Tuple[str]:
return (''.join(sorted(each[0] for each in field.split())),)
@@ -488,9 +452,6 @@ def wholeSetPredicate(field_set):
return (str(field_set),)
-wholeSetPredicate.compounds_with_same_field = False # type: ignore
-
-
def commonSetElementPredicate(field_set):
"""return set as individual elements"""
return tuple([str(each) for each in field_set])
