MCPcopy Create free account
hub / github.com/logpai/logparser / LCSMatch

Method LCSMatch

logparser/Spell/Spell.py:124–149  ·  view source on GitHub ↗
(self, logClustL, seq)

Source from the content-addressed store, hash-verified

122 return retLogClust
123
124 def LCSMatch(self, logClustL, seq):
125 retLogClust = None
126
127 maxLen = -1
128 maxlcs = []
129 maxClust = None
130 set_seq = set(seq)
131 size_seq = len(seq)
132 for logClust in logClustL:
133 set_template = set(logClust.logTemplate)
134 if len(set_seq & set_template) < 0.5 * size_seq:
135 continue
136 lcs = self.LCS(seq, logClust.logTemplate)
137 if len(lcs) > maxLen or (
138 len(lcs) == maxLen
139 and len(logClust.logTemplate) < len(maxClust.logTemplate)
140 ):
141 maxLen = len(lcs)
142 maxlcs = lcs
143 maxClust = logClust
144
145 # LCS should be large then tau * len(itself)
146 if float(maxLen) >= self.tau * size_seq:
147 retLogClust = maxClust
148
149 return retLogClust
150
151 def getTemplate(self, lcs, seq):
152 retVal = []

Callers 1

parseMethod · 0.95

Calls 1

LCSMethod · 0.95

Tested by

no test coverage detected