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
f4d4ea24
Commit
f4d4ea24
authored
Apr 03, 2015
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] Resource Type nicer.
parent
4650a42d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
56 deletions
+8
-56
init_gargantext.py
init/init_gargantext.py
+1
-49
parsers_config.py
parsing/parsers_config.py
+7
-7
No files found.
init/init_gargantext.py
View file @
f4d4ea24
...
@@ -54,16 +54,13 @@ import pycountry
...
@@ -54,16 +54,13 @@ import pycountry
Language
.
objects
.
all
()
.
delete
()
Language
.
objects
.
all
()
.
delete
()
for
language
in
pycountry
.
languages
:
for
language
in
pycountry
.
languages
:
if
'alpha2'
in
language
.
__dict__
:
if
'alpha2'
in
language
.
__dict__
:
Language
(
models
.
Language
(
iso2
=
language
.
alpha2
,
iso2
=
language
.
alpha2
,
iso3
=
language
.
bibliographic
,
iso3
=
language
.
bibliographic
,
fullname
=
language
.
name
,
fullname
=
language
.
name
,
implemented
=
1
if
language
.
alpha2
in
[
'en'
,
'fr'
]
else
0
,
implemented
=
1
if
language
.
alpha2
in
[
'en'
,
'fr'
]
else
0
,
)
.
save
()
)
.
save
()
english
=
Language
.
objects
.
get
(
iso2
=
'en'
)
french
=
Language
.
objects
.
get
(
iso2
=
'fr'
)
# Integration: users
# Integration: users
...
@@ -106,51 +103,6 @@ for parser in parsers.keys():
...
@@ -106,51 +103,6 @@ for parser in parsers.keys():
# TODO
# here some tests
# add a new project and some corpora to test it
# Integration: project
#
#print('Initialize project...')
#try:
# project = Node.objects.get(name='Bees project')
#except:
# project = Node(name='Bees project', type=typeProject, user=me)
# project.save()
#
# Integration: corpus
#print('Initialize corpus...')
#try:
# corpus_pubmed = Node.objects.get(name='PubMed corpus')
#except:
# corpus_pubmed = Node(parent=project, name='PubMed corpus', type=typeCorpus, user=me)
# corpus_pubmed.save()
#
#print('Initialize resource...')
#corpus_pubmed.add_resource(
# # file='./data_samples/pubmed.zip',
# #file='./data_samples/pubmed_2013-04-01_HoneyBeesBeeBees.xml',
# file='/srv/gargantext_lib/data_samples/pubmed.xml',
# type=typePubmed,
# user=me
#)
#
#for resource in corpus_pubmed.get_resources():
# print('Resource #%d - %s - %s' % (resource.id, resource.digest, resource.file))
#
## print('Parse corpus #%d...' % (corpus_pubmed.id, ))
# corpus_pubmed.parse_resources(verbose=True)
# print('Extract corpus #%d...' % (corpus_pubmed.id, ))
# corpus_pubmed.children.all().extract_ngrams(['title',])
# print('Parsed corpus #%d.' % (corpus_pubmed.id, ))
# Instantiante table NgramTag:
# Instantiante table NgramTag:
f
=
open
(
"part_of_speech_labels.txt"
,
'r'
)
f
=
open
(
"part_of_speech_labels.txt"
,
'r'
)
...
...
parsing/parsers_config.py
View file @
f4d4ea24
from
.FileParsers
import
*
from
.FileParsers
import
*
parsers
=
{
parsers
=
{
'Pubmed (xml format)'
:
PubmedFileParser
,
'Pubmed (xml format)'
:
PubmedFileParser
,
'Web of Science (ISI format)'
:
IsiFileParser
,
'Web of Science (ISI format)'
:
IsiFileParser
,
'Scopus
(RIS format)'
:
RisFileParser
,
'Scopus
ou Zotero (RIS format)'
:
RisFileParser
,
'Jstor (RIS format)'
:
JstorFileParser
,
'Jstor (RIS format)'
:
JstorFileParser
,
#'Europress' : EuropressFileParser,
#'Europress'
: EuropressFileParser,
'Europress (French)'
:
EuropressFileParser
,
'Europress (French)'
:
EuropressFileParser
,
'Europress (English)'
:
EuropressFileParser
,
'Europress (English)'
:
EuropressFileParser
,
}
}
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