Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
157
Issues
157
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
540456ba
Commit
540456ba
authored
Jan 19, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Tree type and errors message in Date parsing.
parent
b35ca24c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
14 deletions
+11
-14
gargantext.cabal
gargantext.cabal
+4
-4
Date.hs
src/Data/Gargantext/Parsers/Date.hs
+6
-7
Main.hs
src/Data/Gargantext/Types/Main.hs
+1
-3
No files found.
gargantext.cabal
View file @
540456ba
...
...
@@ -2,19 +2,19 @@
--
-- see: https://github.com/sol/hpack
--
-- hash:
d9ae37baf58628321e1cf53c125f895c9fd3ff19c03fdfaa1ca9b7754fecabf9
-- hash:
985d1caa67e769a2e15fc68e773e608d91e773a04b50f82bcdb4a3997debc1a6
name: gargantext
version: 0.1.0.0
synopsis: Deep (Collaborative) Text mining project
description: Please see README.md
homepage: http://gargantext.org
homepage: http
s
://gargantext.org
license: BSD3
license-file: LICENSE
author: Alexandre Delanoë
maintainer:
gargantext@iscpif.fr
maintainer:
team@gargantext.org
copyright: Copyright: (c) 2016,
201
7
CNRS Alexandre Delanoë
201
8
CNRS Alexandre Delanoë
category: Data
build-type: Simple
cabal-version: >= 1.10
...
...
src/Data/Gargantext/Parsers/Date.hs
View file @
540456ba
{-|
Module : Data.Gargantext.Parsers.Date
Description : Some utils to parse dates
Copyright : (c) CNRS 2017
Copyright : (c) CNRS 2017
-present
License : AGPL + CECILL v3
Maintainer :
dev
@gargantext.org
Maintainer :
team
@gargantext.org
Stability : experimental
Portability : POSIX
According to the language of the text, parseDate1 returns date as Text:
TODO : Add some tests
import Data.Gargantext.Parsers as DGP
import Data.Gargantext.Parsers
.Date
as DGP
DGP.parseDate1 DGP.FR "12 avril 2010" == "2010-04-12T00:00:00.000+00:00"
-}
...
...
@@ -60,10 +60,9 @@ parseDate1 lang text = do
case
headMay
maybeJson
of
Just
(
Json
.
Object
object
)
->
case
HM
.
lookup
"value"
object
of
Just
(
Json
.
String
date
)
->
pure
date
Just
_
->
error
"ERROR: should be a json String"
Nothing
->
error
"No date found"
Just
_
->
error
"ERROR: should be a json Object"
Nothing
->
pure
"No date found"
Just
_
->
error
"ParseDate ERROR: should be a json String"
Nothing
->
error
"ParseDate ERROR: no date found"
_
->
error
"ParseDate ERROR: type error"
...
...
src/Data/Gargantext/Types/Main.hs
View file @
540456ba
...
...
@@ -38,9 +38,7 @@ type ErrorMessage = String
-- TODO make instances of Nodes
-- All the Database is structred like a hierachical Tree
-- Where a is a NodeType:
-- TODO force the logic of the architecture
data
Tree
a
=
Empty
|
Node'
a
(
Tree
a
)
(
Tree
a
)
deriving
(
Show
)
data
Tree
a
=
Leaf
a
|
Node'
[
Tree
a
]
data
NodeType
=
NodeUser
|
Folder
|
Project
|
Corpus
|
Document
...
...
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