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
e88e4d2f
Commit
e88e4d2f
authored
Jul 27, 2016
by
c24b
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NAMING convention for PARSERS dep
parent
87d24fb0
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
298 deletions
+15
-298
constants.py
gargantext/constants.py
+2
-2
EUROPRESSE.py
gargantext/util/parsers/EUROPRESSE.py
+0
-278
ISI.py
gargantext/util/parsers/ISI.py
+3
-4
__init__.py
gargantext/util/parsers/__init__.py
+10
-14
No files found.
gargantext/constants.py
View file @
e88e4d2f
...
...
@@ -243,10 +243,10 @@ def load_crawler(resource):
PARSER filename: ISTEX
PARSER object: ISTexCrawler
'''
filename
=
resource
[
"
name"
]
.
replace
(
"Crawler"
,
""
)
filename
=
resource
[
"
crawler"
]
.
replace
(
"Crawler"
,
""
)
.
upper
(
)
module
=
'gargantext.util.crawlers.
%
s'
%
(
filename
)
module
=
importlib
.
import_module
(
module
)
return
getattr
(
module
,
resource
.
crawler
)
return
getattr
(
module
,
resource
[
"crawler"
]
)
...
...
gargantext/util/parsers/EUROPRESSE.py
deleted
100644 → 0
View file @
87d24fb0
This diff is collapsed.
Click to expand it.
gargantext/util/parsers/ISI.py
View file @
e88e4d2f
from
.R
is
import
RISParser
from
.R
IS
import
RISParser
class
ISIParser
(
RISParser
):
_begin
=
3
_parameters
=
{
b
"ER"
:
{
"type"
:
"delimiter"
},
b
"TI"
:
{
"type"
:
"hyperdata"
,
"key"
:
"title"
,
"separator"
:
" "
},
...
...
@@ -17,4 +17,3 @@ class ISIParser(RISParser):
b
"AB"
:
{
"type"
:
"hyperdata"
,
"key"
:
"abstract"
,
"separator"
:
" "
},
b
"WC"
:
{
"type"
:
"hyperdata"
,
"key"
:
"fields"
},
}
gargantext/util/parsers/__init__.py
View file @
e88e4d2f
import
importlib
from
gargantext.constants
import
RESOURCETYPES
from
gargantext.settings
import
DEBUG
#
if DEBUG:
#
print("Loading available PARSERS:")
if
DEBUG
:
print
(
"Loading available PARSERS:"
)
base_parser
=
"gargantext.util.parsers"
for
resource
in
RESOURCETYPES
:
if
resource
[
"parser"
]
is
not
None
:
#parser file is without Parser
try
:
fname
=
resource
[
"parser"
]
.
replace
(
"Parser"
,
""
)
#parser file is formatted as a title
module
=
base_parser
+
".
%
s"
%
(
fname
.
title
())
#parser module is has shown in constants
parser
=
importlib
.
import_module
(
module
)
#if DEBUG:
# print("\t-", resource["parser"])
#getattr(parser,resource["parser"])
except
Exception
as
e
:
print
(
"Check constants.py
%
s
\n
LANGUAGES declaration of taggers. Parser
%
s is not available"
%
(
str
(
e
),
resource
[
"parser"
]))
fname
=
resource
[
"parser"
]
.
replace
(
"Parser"
,
""
)
#parser file is formatted as a title
module
=
base_parser
+
".
%
s"
%
(
fname
.
upper
())
#parser module is has shown in constants
parser
=
importlib
.
import_module
(
module
)
if
DEBUG
:
print
(
"
\t
-"
,
resource
[
"parser"
])
getattr
(
parser
,
resource
[
"parser"
])
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