From a6d1b2479e991524abf86c6bc983af4194c185a4 Mon Sep 17 00:00:00 2001 From: zhangcheng Date: Mon, 16 Feb 2015 15:49:10 +0800 Subject: [PATCH] build stable sort for graph iteration, then we can get stable result and adatpe details for python 3~ --- jieba/analyse/textrank.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/jieba/analyse/textrank.py b/jieba/analyse/textrank.py index 514077d..1990e64 100644 --- a/jieba/analyse/textrank.py +++ b/jieba/analyse/textrank.py @@ -20,10 +20,6 @@ class UndirectWeightedGraph: self.graph[start].append((start, end, weight)) self.graph[end].append((end, start, weight)) - def refactor(self): - for n, _ in self.graph.items(): - self.graph[n].sort() - def rank(self): ws = collections.defaultdict(float) outSum = collections.defaultdict(float)