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
195
Issues
195
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
f40b051d
Commit
f40b051d
authored
Oct 15, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DATE] parser -> UTCTime
parent
18ceac9c
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
126 additions
and
124 deletions
+126
-124
package.yaml
package.yaml
+8
-7
Core.hs
src/Gargantext/Core.hs
+5
-1
Parsers.hs
src/Gargantext/Text/Parsers.hs
+10
-11
Date.hs
src/Gargantext/Text/Parsers/Date.hs
+102
-104
Wikimedia.hs
src/Gargantext/Text/Parsers/Wikimedia.hs
+1
-1
No files found.
package.yaml
View file @
f40b051d
...
@@ -169,12 +169,12 @@ executables:
...
@@ -169,12 +169,12 @@ executables:
main
:
Main.hs
main
:
Main.hs
source-dirs
:
bin/gargantext-server
source-dirs
:
bin/gargantext-server
ghc-options
:
ghc-options
:
-
-threaded
-
-rtsopts
-
-with-rtsopts=-N
-
-O2
-
-O2
-
-Wmissing-signatures
-
-Wcompat
-
-Wcompat
-
-Wmissing-signatures
-
-rtsopts
-
-threaded
-
-with-rtsopts=-N
dependencies
:
dependencies
:
-
base
-
base
-
containers
-
containers
...
@@ -232,11 +232,12 @@ tests:
...
@@ -232,11 +232,12 @@ tests:
main
:
Main.hs
main
:
Main.hs
source-dirs
:
src-doctest
source-dirs
:
src-doctest
ghc-options
:
ghc-options
:
-
-Werror
-
-O2
-
-threaded
-
-Wcompat
-
-Wmissing-signatures
-
-rtsopts
-
-rtsopts
-
-threaded
-
-with-rtsopts=-N
-
-with-rtsopts=-N
-
-Wmissing-signatures
dependencies
:
dependencies
:
-
doctest
-
doctest
-
Glob
-
Glob
...
...
src/Gargantext/Core.hs
View file @
f40b051d
...
@@ -25,8 +25,12 @@ module Gargantext.Core
...
@@ -25,8 +25,12 @@ module Gargantext.Core
-- - SP == spanish (not implemented yet)
-- - SP == spanish (not implemented yet)
--
--
-- ... add your language and help us to implement it (:
-- ... add your language and help us to implement it (:
data
Lang
=
EN
|
FR
-- | DE | SP | CH
-- | All languages supported
-- TODO : DE | SP | CH
data
Lang
=
EN
|
FR
deriving
(
Show
,
Eq
,
Ord
,
Bounded
,
Enum
)
deriving
(
Show
,
Eq
,
Ord
,
Bounded
,
Enum
)
allLangs
::
[
Lang
]
allLangs
::
[
Lang
]
allLangs
=
[
minBound
..
]
allLangs
=
[
minBound
..
]
src/Gargantext/Text/Parsers.hs
View file @
f40b051d
...
@@ -19,12 +19,13 @@ please follow the types.
...
@@ -19,12 +19,13 @@ please follow the types.
-}
-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE PackageImports #-}
module
Gargantext.Text.Parsers
-- (parse, FileFormat(..)
)
module
Gargantext.Text.Parsers
(
parse
,
FileFormat
(
..
),
clean
)
where
where
import
System.FilePath
(
FilePath
(),
takeExtension
)
import
System.FilePath
(
FilePath
(),
takeExtension
)
import
Codec.Archive.Zip
(
withArchive
,
getEntry
,
getEntries
)
import
"zip"
Codec.Archive.Zip
(
withArchive
,
getEntry
,
getEntries
)
import
Data.Either.Extra
(
partitionEithers
)
import
Data.Either.Extra
(
partitionEithers
)
import
Data.List
(
concat
)
import
Data.List
(
concat
)
...
@@ -49,15 +50,13 @@ import Gargantext.Prelude
...
@@ -49,15 +50,13 @@ import Gargantext.Prelude
import
Gargantext.Text.Parsers.WOS
(
wosParser
)
import
Gargantext.Text.Parsers.WOS
(
wosParser
)
------------------------------------------------------------------------
------------------------------------------------------------------------
type
ParseError
=
String
type
ParseError
=
String
type
Field
=
Text
--type Field = Text
type
Document
=
DM
.
Map
Field
Text
--type Document = DM.Map Field Text
--type FilesParsed = DM.Map FilePath FileParsed
type
FilesParsed
=
DM
.
Map
FilePath
FileParsed
--data FileParsed = FileParsed { _fileParsed_errors :: Maybe ParseError
data
FileParsed
=
FileParsed
{
_fileParsed_errors
::
Maybe
ParseError
-- , _fileParsed_result :: [Document]
,
_fileParsed_result
::
[
Document
]
-- } deriving (Show)
}
deriving
(
Show
)
-- | According to the format of Input file,
-- | According to the format of Input file,
...
@@ -85,7 +84,7 @@ parse format path = do
...
@@ -85,7 +84,7 @@ parse format path = do
-- | withParser:
-- | withParser:
-- According t
he format of the text, choosing
the right parser.
-- According t
o the format of the text, choose
the right parser.
-- TODO withParser :: FileFormat -> Parser [Document]
-- TODO withParser :: FileFormat -> Parser [Document]
withParser
::
FileFormat
->
Parser
[[(
DB
.
ByteString
,
DB
.
ByteString
)]]
withParser
::
FileFormat
->
Parser
[[(
DB
.
ByteString
,
DB
.
ByteString
)]]
withParser
WOS
=
wosParser
withParser
WOS
=
wosParser
...
...
src/Gargantext/Text/Parsers/Date.hs
View file @
f40b051d
This diff is collapsed.
Click to expand it.
src/Gargantext/Text/Parsers/Wikimedia.hs
View file @
f40b051d
...
@@ -27,7 +27,7 @@ import Data.Text as T
...
@@ -27,7 +27,7 @@ import Data.Text as T
import
Data.Either
import
Data.Either
-- | Use case
-- | Use case
--
>>>
:{
-- :{
-- wikimediaFile <- BL.readFile "text.xml"
-- wikimediaFile <- BL.readFile "text.xml"
-- _ <- runConduit $ parseLBS def wikimediaFile
-- _ <- runConduit $ parseLBS def wikimediaFile
-- .| force "mediawiki required" parseMediawiki
-- .| force "mediawiki required" parseMediawiki
...
...
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