Mark center of analysis and include topLists in analysis
This commit is contained in:
parent
07205f37c0
commit
a8d9f96e70
@ -554,10 +554,11 @@ def analyze(G, type_name, name, dist=2.7):
|
|||||||
|
|
||||||
scaleBooksByRating(G)
|
scaleBooksByRating(G)
|
||||||
scaleOpinionsByRating(G)
|
scaleOpinionsByRating(G)
|
||||||
match['value'] = 100
|
#match['value'] = 100
|
||||||
if not 'shape' in match:
|
if not 'shape' in match:
|
||||||
match['shape'] = 'star'
|
match['shape'] = 'star'
|
||||||
addScoreToLabels(G)
|
addScoreToLabels(G)
|
||||||
|
match['label'] = "*"+match['label']+"*"
|
||||||
|
|
||||||
def pruneDist(G, node, n, dist, menge, firstEdge=False):
|
def pruneDist(G, node, n, dist, menge, firstEdge=False):
|
||||||
if dist <= 0:
|
if dist <= 0:
|
||||||
@ -565,6 +566,10 @@ def pruneDist(G, node, n, dist, menge, firstEdge=False):
|
|||||||
dist -= 1
|
dist -= 1
|
||||||
if menge==set():
|
if menge==set():
|
||||||
firstEdge=True
|
firstEdge=True
|
||||||
|
if node['t'] in ['topList']:
|
||||||
|
if firstEdge:
|
||||||
|
menge.add(n)
|
||||||
|
return
|
||||||
menge.add(n)
|
menge.add(n)
|
||||||
if node['t'] in ['tag']:
|
if node['t'] in ['tag']:
|
||||||
if firstEdge:
|
if firstEdge:
|
||||||
@ -575,7 +580,7 @@ def pruneDist(G, node, n, dist, menge, firstEdge=False):
|
|||||||
keeplist = []
|
keeplist = []
|
||||||
for m in list(G.adj[n]):
|
for m in list(G.adj[n]):
|
||||||
book = G.nodes[m]
|
book = G.nodes[m]
|
||||||
if book['t'] not in ['topList']:
|
if book['t'] not in ['NOTHING']:
|
||||||
if 'score' in book and book['score'] != None:
|
if 'score' in book and book['score'] != None:
|
||||||
bestlist.append(book)
|
bestlist.append(book)
|
||||||
elif 'rating' in book and book['rating'] != None:
|
elif 'rating' in book and book['rating'] != None:
|
||||||
|
Loading…
Reference in New Issue
Block a user