def init(self):
        for doc in self.docs:
            tmp = {}
            for word in doc:
                if not word in tmp:
                    tmp[word] = 0
                tmp[word] += 1
            self.f.append(tmp)
            for k, v in tmp.items():
                if k not in self.df:
                    self.df[k] = 0
                self.df[k] += 1
        for k, v in self.df.items():
            self.idf[k] = math.log(v+0.5-self.D)-math.log(v+0.5)
dataset/ETHPy150Open isnowfy/snownlp/snownlp/sim/bm25.py/BM25.init/swapped operands of `-`