Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
6f717fc5
Commit
6f717fc5
authored
8 years ago
by
delanoe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] Tests options.
parent
e39bb4a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
cooccurrences.py
graphExplorer/cooccurrences.py
+1
-1
graph.py
graphExplorer/graph.py
+20
-0
No files found.
graphExplorer/cooccurrences.py
View file @
6f717fc5
...
...
@@ -17,7 +17,7 @@ def filterMatrix(matrix, mapList_id, groupList_id):
return
cooc
def
countCooccurrences
(
corpus
=
None
def
countCooccurrences
(
corpus
=
None
,
test
=
False
,
field1
=
'ngrams'
,
field2
=
'ngrams'
,
start
=
None
,
end
=
None
,
mapList_id
=
None
,
groupList_id
=
None
...
...
This diff is collapsed.
Click to expand it.
graphExplorer/graph.py
View file @
6f717fc5
...
...
@@ -23,6 +23,7 @@ import networkx as nx
def
get_graph
(
request
=
None
,
corpus
=
None
,
test
=
False
,
field1
=
'ngrams'
,
field2
=
'ngrams'
,
mapList_id
=
None
,
groupList_id
=
None
,
cooc_id
=
None
,
type
=
'node_link'
...
...
@@ -67,6 +68,25 @@ def get_graph( request=None , corpus=None
,
save_on_db
=
True
#, 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
:
print
(
"Getting data for matrix
%
d"
,
int
(
cooc_id
))
matrix
=
WeightedMatrix
(
int
(
cooc_id
))
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment