Commit 5b622921 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] Date Parser for WOS

parent 04520d5f
cabal-version: 0.0.5.8.9
cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.34.4.
--
-- see: https://github.com/sol/hpack
name: gargantext
version: 0.0.5.8.9
version: 0.0.5.8.9
synopsis: Search, map, share
description: Please see README.md
category: Data
......
......@@ -105,6 +105,9 @@ dateFlow (DucklingFailure txt) = case readDate $ replace " " "T" txt of
Nothing -> dateFlow (ReadFailure1 txt)
Just ok -> DateFlowSuccess ok
dateFlow (ReadFailure1 txt) = case readDate txt of
Nothing -> dateFlow $ ReadFailure2 txt
Just ok -> DateFlowSuccess ok
dateFlow (ReadFailure2 txt) = case readDate $ replace " " "" txt <> "-01-01T00:00:00" of
Nothing -> DateFlowFailure
Just ok -> DateFlowSuccess ok
dateFlow _ = DateFlowFailure
......
......@@ -47,11 +47,11 @@ notice = start *> many (fieldWith field) <* end
keys :: ByteString -> ByteString
keys champs
| champs == "AF" = "authors"
| champs == "TI" = "title"
| champs == "SO" = "source"
| champs == "DI" = "doi"
| champs == "PD" = "publication_date"
| champs == "AB" = "abstract"
| otherwise = champs
keys field
| field == "AF" = "authors"
| field == "TI" = "title"
| field == "SO" = "source"
| field == "DI" = "doi"
| field == "PY" = "publication_date"
| field == "AB" = "abstract"
| otherwise = field
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment