# HG changeset patch # User Paul Boddie # Date 1290730004 -3600 # Node ID e0bd00412dbc9ac14807de7a3c70b1d8ec0e0ea8 # Parent 2f94fb23bcff230c9e429d70f64bd44d67ccf69d Introduced parameterisation of phrase discovery using different phrase filters to that provided. diff -r 2f94fb23bcff -r e0bd00412dbc iixr/phrases.py --- a/iixr/phrases.py Fri Nov 26 01:05:52 2010 +0100 +++ b/iixr/phrases.py Fri Nov 26 01:06:44 2010 +0100 @@ -80,10 +80,11 @@ "Phrase iteration using the phrase filter." - def __init__(self, sequences): + def __init__(self, sequences, filter=None): CommonIterator.__init__(self, sequences) self.current_doc = None self.current_positions = None + self.filter = filter or PhraseFilter def next(self): @@ -99,7 +100,7 @@ # Handle incomplete phrases. try: - self.current_positions = PhraseFilter(all_positions) + self.current_positions = self.filter(all_positions) except StopIteration: self.current_doc = None continue