You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.../text_matcher/matcher.py in extend_matches(self, cutoff)
267 # If we've gone through the whole list and there's nothing
268 # left to extend, then stop. Otherwise do this again.
--> 269 self.extend_matches()
270
271 return self.healed_matches
.../text_matcher/matcher.py in extend_matches(self, cutoff)
267 # If we've gone through the whole list and there's nothing
268 # left to extend, then stop. Otherwise do this again.
--> 269 self.extend_matches()
270
271 return self.healed_matches
.../text_matcher/matcher.py in extend_matches(self, cutoff)
237 for match in self.healed_matches:
238 # Look one word before.
--> 239 wordA = self.textAgrams[(match.a - 1)][0]
240 wordB = self.textBgrams[(match.b - 1)][0]
241 if self.edit_ratio(wordA, wordB) < cutoff:
IndexError: list index out of range
Thanks for catching this, and for looking into it for me.
My best guess for how to fix this is to maybe check to make sure two texts are not identical before starting the matching. And then just to exit, saying the texts are identical, rather than match with them. But this is maybe not the best way to go. Any ideas for this?
Running command like:
raises IndexError. Sample stack trace:
Error is possibly because of this: https://github.com/JonathanReeve/text-matcher/blob/master/text_matcher/matcher.py#L239 where
match.a
is 0 and the evaluated command becomes:wordA = self.textAgrams[-1][0]
and thus causing an infinite loop.The text was updated successfully, but these errors were encountered: