Commit 7718b763 authored by delanoe's avatar delanoe

[FIX] Number of nodes / graph (need to be checked).

parent 90f232e7
...@@ -61,14 +61,14 @@ def myGraphs(request, project_id, corpus_id): ...@@ -61,14 +61,14 @@ def myGraphs(request, project_id, corpus_id):
coocs_count = dict() coocs_count = dict()
for cooc in coocs: for cooc in coocs:
# FIXME : approximativ number of nodes (not exactly what user sees in explorer) # FIXME : approximativ number of nodes (not exactly what user sees in explorer)
cooc_nodes = (session.query(Ngram) cooc_nodes = (session.query(Ngram.id)
.join(NodeNgramNgram, NodeNgramNgram.ngram1_id == Ngram.id) .join(NodeNgramNgram, NodeNgramNgram.ngram1_id == Ngram.id)
.filter(NodeNgramNgram.node_id==cooc.id) .filter(NodeNgramNgram.node_id==cooc.id)
.filter(NodeNgramNgram.weight > 0) .filter(NodeNgramNgram.weight > 0)
.all() .all()
) )
coocs_count[cooc.id] = len(cooc_nodes)
#coocs_count[cooc.id] = len(list(set(cooc_nodes))) coocs_count[cooc.id] = len(set(cooc_nodes))
return render( return render(
template_name = 'pages/corpora/myGraphs.html', template_name = 'pages/corpora/myGraphs.html',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment