| 94 | return result |
| 95 | |
| 96 | def SimpleLoopMatch(self, logClustL, seq): |
| 97 | for logClust in logClustL: |
| 98 | if float(len(logClust.logTemplate)) < 0.5 * len(seq): |
| 99 | continue |
| 100 | # Check the template is a subsequence of seq (we use set checking as a proxy here for speedup since |
| 101 | # incorrect-ordering bad cases rarely occur in logs) |
| 102 | token_set = set(seq) |
| 103 | if all( |
| 104 | token in token_set or token == "<*>" for token in logClust.logTemplate |
| 105 | ): |
| 106 | return logClust |
| 107 | return None |
| 108 | |
| 109 | def PrefixTreeMatch(self, parentn, seq, idx): |
| 110 | retLogClust = None |