Returns a list of all matches found in the given sentence.
(self, sentence)
| 740 | return P |
| 741 | |
| 742 | def search(self, sentence): |
| 743 | """ Returns a list of all matches found in the given sentence. |
| 744 | """ |
| 745 | if sentence.__class__.__name__ == "Text": |
| 746 | a=[]; [a.extend(self.search(s)) for s in sentence]; return a |
| 747 | a = [] |
| 748 | v = self._variations() |
| 749 | u = {} |
| 750 | m = self.match(sentence, _v=v) |
| 751 | while m: |
| 752 | a.append(m) |
| 753 | m = self.match(sentence, start=m.words[-1].index+1, _v=v, _u=u) |
| 754 | return a |
| 755 | |
| 756 | def match(self, sentence, start=0, _v=None, _u=None): |
| 757 | """ Returns the first match found in the given sentence, or None. |