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
1b523c37
Commit
1b523c37
authored
Jan 21, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] hard path in dependencies.
parent
540456ba
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
9 deletions
+19
-9
package.yaml
package.yaml
+1
-0
Date.hs
src/Data/Gargantext/Parsers/Date.hs
+15
-6
Chronos.purs
src/Data/Gargantext/Utils/Chronos.purs
+0
-0
stack.yaml
stack.yaml
+3
-3
No files found.
package.yaml
View file @
1b523c37
...
@@ -92,6 +92,7 @@ library:
...
@@ -92,6 +92,7 @@ library:
-
split
-
split
-
tagsoup
-
tagsoup
-
text-metrics
-
text-metrics
# - utc
-
time
-
time
-
timezone-series
-
timezone-series
-
time-locale-compat
-
time-locale-compat
...
...
src/Data/Gargantext/Parsers/Date.hs
View file @
1b523c37
...
@@ -16,7 +16,7 @@ DGP.parseDate1 DGP.FR "12 avril 2010" == "2010-04-12T00:00:00.000+00:00"
...
@@ -16,7 +16,7 @@ DGP.parseDate1 DGP.FR "12 avril 2010" == "2010-04-12T00:00:00.000+00:00"
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE OverloadedStrings #-}
module
Data.Gargantext.Parsers.Date
(
parseDate1
,
Lang
(
FR
,
EN
))
where
module
Data.Gargantext.Parsers.Date
(
parseDate1
,
Lang
(
FR
,
EN
)
,
parseDate
)
where
import
Data.Gargantext.Prelude
import
Data.Gargantext.Prelude
--import Data.Gargantext.Types.Main as G
--import Data.Gargantext.Types.Main as G
...
@@ -28,10 +28,9 @@ import Duckling.Resolve (fromUTC, Context(Context, referenceTime, locale)
...
@@ -28,10 +28,9 @@ import Duckling.Resolve (fromUTC, Context(Context, referenceTime, locale)
,
DucklingTime
(
DucklingTime
)
,
DucklingTime
(
DucklingTime
)
)
)
import
Duckling.Core
(
makeLocale
,
Lang
(
FR
,
EN
),
Some
(
This
),
Dimension
(
Time
))
import
Duckling.Core
(
makeLocale
,
Lang
(
FR
,
EN
),
Some
(
This
),
Dimension
(
Time
))
import
Duckling.Types
(
jsonValue
)
import
Duckling.Types
(
jsonValue
,
Entity
)
--import qualified Duckling.Core as DC
import
Duckling.Api
(
analyze
)
import
Duckling.Api
(
analyze
,
parse
)
import
qualified
Data.HashSet
as
HashSet
import
qualified
Data.HashSet
as
HashSet
import
qualified
Data.Aeson
as
Json
import
qualified
Data.Aeson
as
Json
import
Data.HashMap.Strict
as
HM
import
Data.HashMap.Strict
as
HM
...
@@ -78,7 +77,17 @@ localContext lang dt = Context {referenceTime = dt, locale = makeLocale lang Not
...
@@ -78,7 +77,17 @@ localContext lang dt = Context {referenceTime = dt, locale = makeLocale lang Not
-- | Date parser with Duckling
-- | Date parser with Duckling
parseDateWithDuckling
::
Lang
->
Text
->
IO
[
ResolvedToken
]
parseDateWithDuckling
::
Lang
->
Text
->
IO
[
ResolvedToken
]
parseDateWithDuckling
lang
input
=
do
parseDateWithDuckling
lang
input
=
do
c
tx
<-
localContext
lang
<$>
utcToDucklingTime
<$>
getCurrentTime
c
ontxt
<-
localContext
lang
<$>
utcToDucklingTime
<$>
getCurrentTime
--pure $ parseAndResolve (rulesFor (locale ctx) (HashSet.fromList [(This Time)])) input ctx
--pure $ parseAndResolve (rulesFor (locale ctx) (HashSet.fromList [(This Time)])) input ctx
pure
$
analyze
input
ctx
$
HashSet
.
fromList
[(
This
Time
)]
pure
$
analyze
input
contxt
$
HashSet
.
fromList
[(
This
Time
)]
parseDate
::
Lang
->
Text
->
IO
[
Entity
]
parseDate
lang
input
=
do
context
<-
localContext
lang
<$>
utcToDucklingTime
<$>
getCurrentTime
pure
$
parse
input
context
[(
This
Time
)]
src/Data/Gargantext/Utils/Chronos
_h
s
→
src/Data/Gargantext/Utils/Chronos
.pur
s
View file @
1b523c37
File moved
stack.yaml
View file @
1b523c37
...
@@ -2,11 +2,11 @@ flags: {}
...
@@ -2,11 +2,11 @@ flags: {}
extra-package-dbs
:
[]
extra-package-dbs
:
[]
packages
:
packages
:
-
.
-
.
-
/home/alexandre/local/logiciels/haskell/servant/servant-multipart
#- /home/alexandre/local/logiciels/haskell/servant/servant-multipart
#- /home/alexandre/local/logiciels/haskell/utc
extra-deps
:
extra-deps
:
-
aeson-1.0.2.1
-
aeson-1.0.2.1
-
duckling-0.1.3.0
-
duckling-0.1.3.0
-
protolude-0.2
-
protolude-0.2
-
generic-lens-0.4.0.1
-
servant-multipart-0.10.0.1
-
GenericPretty-1.2.1
resolver
:
lts-9.2
resolver
:
lts-9.2
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