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
28a600f5
Commit
28a600f5
authored
Sep 02, 2015
by
delanoe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] bugs on test
parent
0f25cb4a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
db.py
gargantext_web/db.py
+4
-1
test-node.py
test-node.py
+3
-3
No files found.
gargantext_web/db.py
View file @
28a600f5
...
@@ -162,10 +162,13 @@ class bulk_insert:
...
@@ -162,10 +162,13 @@ class bulk_insert:
def
read
(
self
,
size
=
None
):
def
read
(
self
,
size
=
None
):
try
:
try
:
return
self
.
template
%
tuple
(
test
=
self
.
template
%
tuple
(
'
\\
N'
if
x
is
None
else
str
(
x
)
.
replace
(
'
\r
'
,
' '
)
.
replace
(
'
\n
'
,
' '
)
.
replace
(
'
\t
'
,
' '
)
.
replace
(
"
\\
"
,
""
)
'
\\
N'
if
x
is
None
else
str
(
x
)
.
replace
(
'
\r
'
,
' '
)
.
replace
(
'
\n
'
,
' '
)
.
replace
(
'
\t
'
,
' '
)
.
replace
(
"
\\
"
,
""
)
for
x
in
next
(
self
.
iter
)
for
x
in
next
(
self
.
iter
)
)
)
print
(
test
)
return
test
except
StopIteration
:
except
StopIteration
:
return
''
return
''
...
...
test-node.py
View file @
28a600f5
...
@@ -10,7 +10,7 @@ from gargantext_web.db import Session, Base, Node, NodeNgram, Ngram
...
@@ -10,7 +10,7 @@ from gargantext_web.db import Session, Base, Node, NodeNgram, Ngram
# test!
# test!
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
step
=
2
step
=
1
session
=
Session
()
session
=
Session
()
# nodes creation
# nodes creation
...
@@ -44,8 +44,8 @@ if __name__ == '__main__':
...
@@ -44,8 +44,8 @@ if __name__ == '__main__':
corpus
.
append
(
document
)
corpus
.
append
(
document
)
root
.
append
(
corpus
)
root
.
append
(
corpus
)
print
(
root
)
#
print(root)
# ngrams extraction
# ngrams extraction
elif
step
==
1
:
elif
step
==
1
:
root
=
session
.
query
(
Node
)
.
filter
(
Node
.
depth
==
0
)
.
first
()
root
=
session
.
query
(
Node
)
.
filter
(
Node
.
depth
==
0
)
.
first
()
...
...
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