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. -- This file has been generated from package.yaml by hpack version 0.34.4.
-- --
-- see: https://github.com/sol/hpack -- see: https://github.com/sol/hpack
name: gargantext name: gargantext
version: 0.0.5.8.9 version: 0.0.5.8.9
synopsis: Search, map, share synopsis: Search, map, share
description: Please see README.md description: Please see README.md
category: Data category: Data
......
...@@ -105,6 +105,9 @@ dateFlow (DucklingFailure txt) = case readDate $ replace " " "T" txt of ...@@ -105,6 +105,9 @@ dateFlow (DucklingFailure txt) = case readDate $ replace " " "T" txt of
Nothing -> dateFlow (ReadFailure1 txt) Nothing -> dateFlow (ReadFailure1 txt)
Just ok -> DateFlowSuccess ok Just ok -> DateFlowSuccess ok
dateFlow (ReadFailure1 txt) = case readDate txt of 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 Nothing -> DateFlowFailure
Just ok -> DateFlowSuccess ok Just ok -> DateFlowSuccess ok
dateFlow _ = DateFlowFailure dateFlow _ = DateFlowFailure
......
...@@ -47,11 +47,11 @@ notice = start *> many (fieldWith field) <* end ...@@ -47,11 +47,11 @@ notice = start *> many (fieldWith field) <* end
keys :: ByteString -> ByteString keys :: ByteString -> ByteString
keys champs keys field
| champs == "AF" = "authors" | field == "AF" = "authors"
| champs == "TI" = "title" | field == "TI" = "title"
| champs == "SO" = "source" | field == "SO" = "source"
| champs == "DI" = "doi" | field == "DI" = "doi"
| champs == "PD" = "publication_date" | field == "PY" = "publication_date"
| champs == "AB" = "abstract" | field == "AB" = "abstract"
| otherwise = champs | 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