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
961ba2d8
Commit
961ba2d8
authored
Jul 27, 2016
by
c24b
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
corpus.languages + corpus.skipped_docs in parsing
parent
7a0d083f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
parsing.py
gargantext/util/toolchain/parsing.py
+4
-4
No files found.
gargantext/util/toolchain/parsing.py
View file @
961ba2d8
...
...
@@ -2,7 +2,7 @@ from gargantext.util.db import *
from
gargantext.models
import
*
from
gargantext.constants
import
*
from
gargantext.util.parsers
import
*
from
collections
import
defaultdict
from
collections
import
defaultdict
,
Counter
from
re
import
sub
def
parse
(
corpus
):
...
...
@@ -55,6 +55,8 @@ def parse(corpus):
session
.
add
(
document
)
if
document
.
hyperdata
.
has_key
(
"error"
):
#document.status("error")
document
.
status
(
'Parsing'
,
error
=
document
.
hyperdata
[
"error"
])
#session.delete(document)
corpus
.
skipped_docs
.
append
(
document
.
id
)
...
...
@@ -66,9 +68,7 @@ def parse(corpus):
documents_count
+=
1
# update info about the resource
resource
[
'extracted'
]
=
True
# add a corpus-level info about languages...
corpus
.
hyperdata
[
'languages'
]
=
observed_languages
# ...with a special key inside for skipped languages at ngrams_extraction
# add a corpus-level info about languages adding a __skipped__ info
corpus
.
hyperdata
[
'languages'
][
'__skipped__'
]
=
Counter
(
skipped_languages
)
# commit all changes
corpus
.
status
(
'Docs'
,
progress
=
documents_count
,
complete
=
True
)
...
...
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