def _constructRules(self, templateCombinations):

        def getTokens(mid):
            if mid == -1:
                return []
            else:
                return self.dh.getTokensForMsg(mid)

        def getFields(tid):
            if tid == -1:
                return []
            else:
                return self.structureTemplates[tid].getFieldIndices()

        for (templateIds, msgs) in templateCombinations.iteritems():
            tids = [int(tid) for tid in templateIds.split(TEMPLATE_SEP)]
            fieldsForMessages = [None] * len(tids)
            for (ind, tid) in enumerate(tids):
                tokenizedMessages = [getTokens(mids[ind]) for mids in msgs]
                fieldsForMessages[ind] = FieldArray(tokenizedMessages,
                                                    getFields(tid))
            ruleSet = rule.RuleSet(templateIds, tids)
            ruleSet.gatherRules(fieldsForMessages, 0 > self.ngram)
            self.rules[templateIds] = ruleSet
dataset/ETHPy150Open hgascon/pulsar/pulsar/core/model.py/ModelFilesGenerator._constructRules/swapped operands of `>`