diff --git a/parsing/FileParsers/EuropressFileParser_old.py b/parsing/FileParsers/EuropressFileParser_old.py index ebc429d94a2e57afdb296573af30f34d884bad02..6b3d512395151b27da41bcfc1e7a527f0c09bc8e 100644 --- a/parsing/FileParsers/EuropressFileParser_old.py +++ b/parsing/FileParsers/EuropressFileParser_old.py @@ -1,7 +1,7 @@ import sys sys.path.append('/srv/gargantext') -from admin.env import * +#from admin.env import * import re import locale from lxml import etree @@ -168,6 +168,7 @@ class EuropressFileParser(FileParser): if test_date_fr is not None or test_date_fr_v2 is not None: + hyperdata['language_iso2'] = 'fr' self.localeEncoding = "fr_FR" locale.setlocale(locale.LC_ALL, "fr_FR.utf-8") if encoding != "utf-8": @@ -198,6 +199,7 @@ class EuropressFileParser(FileParser): if test_date_en is not None: + hyperdata['language_iso2'] = 'en' localeEncoding = "en_GB.UTF-8" locale.setlocale(locale.LC_ALL, localeEncoding) try : @@ -259,10 +261,6 @@ class EuropressFileParser(FileParser): except : hyperdata['publication_date'] = timezone.now() - #if lang == 'fr': - #hyperdata['language_iso2'] = 'fr' - #elif lang == 'en': - # hyperdata['language_iso2'] = 'en' hyperdata['publication_year'] = hyperdata['publication_date'].strftime('%Y') hyperdata['publication_month'] = hyperdata['publication_date'].strftime('%m') diff --git a/parsing/FileParsers/__init__.py b/parsing/FileParsers/__init__.py index 14a8cf24ac86c029545dfb655e1ca9bf913082a1..f0c78320bb955a1fa97d770478d46cd6e05d1bfc 100644 --- a/parsing/FileParsers/__init__.py +++ b/parsing/FileParsers/__init__.py @@ -3,6 +3,7 @@ from .IsiFileParser import IsiFileParser from .JstorFileParser import JstorFileParser from .ZoteroFileParser import ZoteroFileParser from .PubmedFileParser import PubmedFileParser +from .EuropressFileParser_old import EuropressFileParser from .EuropressFileParser_en import EuropressFileParser_en from .EuropressFileParser_fr import EuropressFileParser_fr from .ISTex import ISTex diff --git a/parsing/parsers_config.py b/parsing/parsers_config.py index f504479cbbcc10548e3845446a6d35d633f9a144..8f126d7df47700916dfbc6cd1f9cc0dc006b8040 100644 --- a/parsing/parsers_config.py +++ b/parsing/parsers_config.py @@ -6,7 +6,7 @@ parsers = { 'Scopus (RIS format)' : RisFileParser, 'Zotero (RIS format)' : ZoteroFileParser, 'Jstor (RIS format)' : JstorFileParser, - #'Europress' : EuropressFileParser, + 'Europress (old corpora)' : EuropressFileParser, 'Europress (French)' : EuropressFileParser_fr, 'Europress (English)' : EuropressFileParser_en, 'CSVParser' : CSVParser,