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
9929f336
Commit
9929f336
authored
Apr 17, 2015
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] inherited variables to adapt parsing according Isi or Ris or Zotero.
parent
f2f231c7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
37 deletions
+48
-37
IsiFileParser.py
parsing/FileParsers/IsiFileParser.py
+15
-11
JstorFileParser.py
parsing/FileParsers/JstorFileParser.py
+15
-12
RisFileParser.py
parsing/FileParsers/RisFileParser.py
+17
-13
parsers_config.py
parsing/parsers_config.py
+1
-1
No files found.
parsing/FileParsers/IsiFileParser.py
View file @
9929f336
...
@@ -4,14 +4,18 @@ from .RisFileParser import RisFileParser
...
@@ -4,14 +4,18 @@ from .RisFileParser import RisFileParser
class
IsiFileParser
(
RisFileParser
):
class
IsiFileParser
(
RisFileParser
):
_parameters
=
{
def
__init__
(
self
):
b
"ER"
:
{
"type"
:
"delimiter"
},
super
(
RisFileParser
,
self
)
.
__init__
()
b
"TI"
:
{
"type"
:
"metadata"
,
"key"
:
"title"
,
"separator"
:
" "
},
self
.
_parameters
=
{
b
"AU"
:
{
"type"
:
"metadata"
,
"key"
:
"authors"
,
"separator"
:
", "
},
b
"ER"
:
{
"type"
:
"delimiter"
},
b
"DI"
:
{
"type"
:
"metadata"
,
"key"
:
"doi"
},
b
"TI"
:
{
"type"
:
"metadata"
,
"key"
:
"title"
,
"separator"
:
" "
},
b
"PY"
:
{
"type"
:
"metadata"
,
"key"
:
"publication_year"
},
b
"AU"
:
{
"type"
:
"metadata"
,
"key"
:
"authors"
,
"separator"
:
", "
},
b
"PD"
:
{
"type"
:
"metadata"
,
"key"
:
"publication_month"
},
b
"DI"
:
{
"type"
:
"metadata"
,
"key"
:
"doi"
},
b
"LA"
:
{
"type"
:
"metadata"
,
"key"
:
"language_fullname"
},
b
"PY"
:
{
"type"
:
"metadata"
,
"key"
:
"publication_year"
},
b
"AB"
:
{
"type"
:
"metadata"
,
"key"
:
"abstract"
,
"separator"
:
" "
},
b
"PD"
:
{
"type"
:
"metadata"
,
"key"
:
"publication_month"
},
b
"WC"
:
{
"type"
:
"metadata"
,
"key"
:
"fields"
},
b
"LA"
:
{
"type"
:
"metadata"
,
"key"
:
"language_fullname"
},
}
b
"AB"
:
{
"type"
:
"metadata"
,
"key"
:
"abstract"
,
"separator"
:
" "
},
b
"WC"
:
{
"type"
:
"metadata"
,
"key"
:
"fields"
},
}
self
.
_begin
=
3
parsing/FileParsers/JstorFileParser.py
View file @
9929f336
...
@@ -2,17 +2,20 @@ from .RisFileParser import RisFileParser
...
@@ -2,17 +2,20 @@ from .RisFileParser import RisFileParser
class
JstorFileParser
(
RisFileParser
):
class
JstorFileParser
(
RisFileParser
):
def
__init__
(
self
):
super
(
RisFileParser
,
self
)
.
__init__
()
_parameters
=
{
_parameters
=
{
b
"ER"
:
{
"type"
:
"delimiter"
},
b
"ER"
:
{
"type"
:
"delimiter"
},
b
"TI"
:
{
"type"
:
"metadata"
,
"key"
:
"title"
,
"separator"
:
" "
},
b
"TI"
:
{
"type"
:
"metadata"
,
"key"
:
"title"
,
"separator"
:
" "
},
b
"AU"
:
{
"type"
:
"metadata"
,
"key"
:
"authors"
,
"separator"
:
", "
},
b
"AU"
:
{
"type"
:
"metadata"
,
"key"
:
"authors"
,
"separator"
:
", "
},
b
"UR"
:
{
"type"
:
"metadata"
,
"key"
:
"doi"
},
b
"UR"
:
{
"type"
:
"metadata"
,
"key"
:
"doi"
},
b
"Y1"
:
{
"type"
:
"metadata"
,
"key"
:
"publication_year"
},
b
"Y1"
:
{
"type"
:
"metadata"
,
"key"
:
"publication_year"
},
b
"PD"
:
{
"type"
:
"metadata"
,
"key"
:
"publication_month"
},
b
"PD"
:
{
"type"
:
"metadata"
,
"key"
:
"publication_month"
},
b
"LA"
:
{
"type"
:
"metadata"
,
"key"
:
"language_iso2"
},
b
"LA"
:
{
"type"
:
"metadata"
,
"key"
:
"language_iso2"
},
b
"AB"
:
{
"type"
:
"metadata"
,
"key"
:
"abstract"
,
"separator"
:
" "
},
b
"AB"
:
{
"type"
:
"metadata"
,
"key"
:
"abstract"
,
"separator"
:
" "
},
b
"WC"
:
{
"type"
:
"metadata"
,
"key"
:
"fields"
},
b
"WC"
:
{
"type"
:
"metadata"
,
"key"
:
"fields"
},
}
}
begin
=
3
parsing/FileParsers/RisFileParser.py
View file @
9929f336
...
@@ -4,18 +4,22 @@ from .FileParser import FileParser
...
@@ -4,18 +4,22 @@ from .FileParser import FileParser
class
RisFileParser
(
FileParser
):
class
RisFileParser
(
FileParser
):
_parameters
=
{
def
__init__
(
self
):
b
"ER"
:
{
"type"
:
"delimiter"
},
super
(
FileParser
,
self
)
.
__init__
()
b
"TI"
:
{
"type"
:
"metadata"
,
"key"
:
"title"
,
"separator"
:
" "
},
self
.
_parameters
=
{
b
"ST"
:
{
"type"
:
"metadata"
,
"key"
:
"subtitle"
,
"separator"
:
" "
},
b
"ER"
:
{
"type"
:
"delimiter"
},
b
"AU"
:
{
"type"
:
"metadata"
,
"key"
:
"authors"
,
"separator"
:
", "
},
b
"TI"
:
{
"type"
:
"metadata"
,
"key"
:
"title"
,
"separator"
:
" "
},
b
"UR"
:
{
"type"
:
"metadata"
,
"key"
:
"doi"
},
b
"ST"
:
{
"type"
:
"metadata"
,
"key"
:
"subtitle"
,
"separator"
:
" "
},
b
"PY"
:
{
"type"
:
"metadata"
,
"key"
:
"publication_year"
},
b
"AU"
:
{
"type"
:
"metadata"
,
"key"
:
"authors"
,
"separator"
:
", "
},
b
"PD"
:
{
"type"
:
"metadata"
,
"key"
:
"publication_month"
},
b
"UR"
:
{
"type"
:
"metadata"
,
"key"
:
"doi"
},
b
"LA"
:
{
"type"
:
"metadata"
,
"key"
:
"language_iso2"
},
b
"PY"
:
{
"type"
:
"metadata"
,
"key"
:
"publication_year"
},
b
"AB"
:
{
"type"
:
"metadata"
,
"key"
:
"abstract"
,
"separator"
:
" "
},
b
"PD"
:
{
"type"
:
"metadata"
,
"key"
:
"publication_month"
},
b
"WC"
:
{
"type"
:
"metadata"
,
"key"
:
"fields"
},
b
"LA"
:
{
"type"
:
"metadata"
,
"key"
:
"language_iso2"
},
}
b
"AB"
:
{
"type"
:
"metadata"
,
"key"
:
"abstract"
,
"separator"
:
" "
},
b
"WC"
:
{
"type"
:
"metadata"
,
"key"
:
"fields"
},
}
self
.
_begin
=
6
def
_parse
(
self
,
file
):
def
_parse
(
self
,
file
):
metadata
=
{}
metadata
=
{}
...
@@ -43,7 +47,7 @@ class RisFileParser(FileParser):
...
@@ -43,7 +47,7 @@ class RisFileParser(FileParser):
last_key
=
parameter_key
last_key
=
parameter_key
last_values
=
[]
last_values
=
[]
try
:
try
:
last_values
.
append
(
line
[
6
:
-
1
]
.
decode
())
last_values
.
append
(
line
[
self
.
_begin
:
-
1
]
.
decode
())
except
Exception
as
error
:
except
Exception
as
error
:
print
(
error
)
print
(
error
)
# if a metadata object is left in memory, yield it as well
# if a metadata object is left in memory, yield it as well
...
...
parsing/parsers_config.py
View file @
9929f336
...
@@ -4,7 +4,7 @@ parsers = {
...
@@ -4,7 +4,7 @@ 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 (RIS format)'
:
RisFileParser
,
'Zotero (RIS format)'
:
Ris
FileParser
,
'Zotero (RIS format)'
:
Jstor
FileParser
,
'Jstor (RIS format)'
:
JstorFileParser
,
'Jstor (RIS format)'
:
JstorFileParser
,
#'Europress' : EuropressFileParser,
#'Europress' : EuropressFileParser,
'Europress (French)'
:
EuropressFileParser
,
'Europress (French)'
:
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