Commit 1f76b796 authored by delanoe's avatar delanoe

[FEAT] Tests options.

parent a1565646
...@@ -17,7 +17,7 @@ def filterMatrix(matrix, mapList_id, groupList_id): ...@@ -17,7 +17,7 @@ def filterMatrix(matrix, mapList_id, groupList_id):
return cooc return cooc
def countCooccurrences( corpus=None def countCooccurrences( corpus=None , test= False
, field1='ngrams' , field2='ngrams' , field1='ngrams' , field2='ngrams'
, start=None , end=None , start=None , end=None
, mapList_id=None , groupList_id=None , mapList_id=None , groupList_id=None
......
...@@ -23,6 +23,7 @@ import networkx as nx ...@@ -23,6 +23,7 @@ import networkx as nx
def get_graph( request=None , corpus=None def get_graph( request=None , corpus=None
, test= False
, field1='ngrams' , field2='ngrams' , field1='ngrams' , field2='ngrams'
, mapList_id = None , groupList_id = None , mapList_id = None , groupList_id = None
, cooc_id=None , type='node_link' , cooc_id=None , type='node_link'
...@@ -67,6 +68,25 @@ def get_graph( request=None , corpus=None ...@@ -67,6 +68,25 @@ def get_graph( request=None , corpus=None
, save_on_db = True , save_on_db = True
#, limit=size #, limit=size
) )
if test = True:
cooc_matrix = countCooccurrences( corpus=corpus, test=test
#, field1="ngrams", field2="ngrams"
, start=start , end =end
, mapList_id=mapList_id , groupList_id=groupList_id
, isMonopartite=True , threshold = threshold
, save_on_db = True
#, limit=size
)
else:
cooc_matrix = countCooccurrences( corpus=corpus, test=test
#, field1="ngrams", field2="ngrams"
, start=start , end =end
, mapList_id=mapList_id , groupList_id=groupList_id
, isMonopartite=True , threshold = threshold
, save_on_db = True
#, limit=size
)
else: else:
print("Getting data for matrix %d", int(cooc_id)) print("Getting data for matrix %d", int(cooc_id))
matrix = WeightedMatrix(int(cooc_id)) matrix = WeightedMatrix(int(cooc_id))
......
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