def __init__(self, discriminator, lexicon=None, index=None): if not callable(discriminator): if not isinstance(discriminator, six.string_types): raise ValueError('discriminator value must be callable or a ' 'string') self.discriminator = discriminator self._not_indexed = self.family.IF.Set() TextIndex.__init__(self, lexicon, index) self.clear()
def __init__(self, discriminator, lexicon=None, index=None): self._init_discriminator(discriminator) self._not_indexed = self.family.IF.Set() lexicon = lexicon or Lexicon(Splitter(), CaseNormalizer(), StopWordRemover()) index = index or OkapiIndex(lexicon, family=self.family) ZopeTextIndex.__init__(self, lexicon, index) self.clear()