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
6740e4df
Commit
6740e4df
authored
Jul 27, 2016
by
c24b
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IMPORT constants crawlers+ taggers
parent
9c5c9d7e
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
198 additions
and
98 deletions
+198
-98
constants.py
gargantext/constants.py
+147
-94
__init__.py
gargantext/util/crawlers/__init__.py
+25
-0
__init__.py
gargantext/util/taggers/__init__.py
+26
-4
No files found.
gargantext/constants.py
View file @
6740e4df
This diff is collapsed.
Click to expand it.
gargantext/util/crawlers/__init__.py
0 → 100644
View file @
6740e4df
import
importlib
from
gargantext.constants
import
RESOURCETYPES
from
gargantext.settings
import
DEBUG
#if DEBUG: print("Loading available Crawlers")
base_parser
=
"gargantext.util.crawlers"
for
resource
in
RESOURCETYPES
:
if
resource
[
"crawler"
]
is
not
None
:
try
:
name
=
resource
[
"crawler"
]
#crawler is type basename+"Crawler"
filename
=
name
.
replace
(
"Crawler"
,
""
)
.
lower
()
module
=
base_parser
+
".
%
s"
%
(
filename
)
importlib
.
import_module
(
module
)
#if DEBUG: print("\t-", name)
except
Exception
as
e
:
print
(
"Check constants.py RESOURCETYPES declaration
%
s
\n
CRAWLER
%
s is not available for
%
s"
%
(
str
(
e
),
resource
[
"crawler"
],
resource
[
"name"
]))
#initial import
#from .cern import CernCrawler
#from .istex import ISTexCrawler
#from .pubmed import PubmedCrawler
gargantext/util/taggers/__init__.py
View file @
6740e4df
from
.TurboTagger
import
TurboTagger
#version2
from
.NltkTagger
import
NltkTagger
#imported as needed
from
.TreeTagger
import
TreeTagger
from
.MeltTagger
import
EnglishMeltTagger
,
FrenchMeltTagger
#Version 1
#~ import importlib
#~ from gargantext.constants import LANGUAGES
#~ from gargantext.settings import DEBUG
#~ if DEBUG:
#~ print("Loading available Taggers:")
#~ for lang, tagger in LANGUAGES.items():
#~ tagger = tagger["tagger"]
#~ filename = "gargantext.util.taggers.%s" %(tagger)
#~ if DEBUG:
#~ print("\t-%s (%s)" %(tagger, lang))
#~ getattr(importlib.import_module(filename), tagger)()
#VERSION 0
#~ #initally a manual import declaration
#~ from .TurboTagger import TurboTagger
#~ from .NltkTagger import NltkTagger
#~ from .TreeTagger import TreeTagger
#~ from .MeltTagger import EnglishMeltTagger, FrenchMeltTagger
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