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
148
Issues
148
List
Board
Labels
Milestones
Merge Requests
11
Merge Requests
11
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:
main
:
Main.hs
source-dirs
:
bin/gargantext-server
ghc-options
:
-
-threaded
-
-rtsopts
-
-with-rtsopts=-N
-
-O2
-
-Wmissing-signatures
-
-Wcompat
-
-Wmissing-signatures
-
-rtsopts
-
-threaded
-
-with-rtsopts=-N
dependencies
:
-
base
-
containers
...
...
@@ -232,11 +232,12 @@ tests:
main
:
Main.hs
source-dirs
:
src-doctest
ghc-options
:
-
-Werror
-
-threaded
-
-O2
-
-Wcompat
-
-Wmissing-signatures
-
-rtsopts
-
-threaded
-
-with-rtsopts=-N
-
-Wmissing-signatures
dependencies
:
-
doctest
-
Glob
...
...
src/Gargantext/Core.hs
View file @
f40b051d
...
...
@@ -25,8 +25,12 @@ module Gargantext.Core
-- - SP == spanish (not implemented yet)
--
-- ... 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
)
allLangs
::
[
Lang
]
allLangs
=
[
minBound
..
]
src/Gargantext/Text/Parsers.hs
View file @
f40b051d
...
...
@@ -19,12 +19,13 @@ please follow the types.
-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE PackageImports #-}
module
Gargantext.Text.Parsers
-- (parse, FileFormat(..)
)
module
Gargantext.Text.Parsers
(
parse
,
FileFormat
(
..
),
clean
)
where
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.List
(
concat
)
...
...
@@ -49,15 +50,13 @@ import Gargantext.Prelude
import
Gargantext.Text.Parsers.WOS
(
wosParser
)
------------------------------------------------------------------------
type
ParseError
=
String
type
Field
=
Text
type
Document
=
DM
.
Map
Field
Text
type
FilesParsed
=
DM
.
Map
FilePath
FileParsed
data
FileParsed
=
FileParsed
{
_fileParsed_errors
::
Maybe
ParseError
,
_fileParsed_result
::
[
Document
]
}
deriving
(
Show
)
--type Field = Text
--type Document = DM.Map Field Text
--type FilesParsed = DM.Map FilePath FileParsed
--data FileParsed = FileParsed { _fileParsed_errors :: Maybe ParseError
-- , _fileParsed_result :: [Document]
-- } deriving (Show)
-- | According to the format of Input file,
...
...
@@ -85,7 +84,7 @@ parse format path = do
-- | 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]
withParser
::
FileFormat
->
Parser
[[(
DB
.
ByteString
,
DB
.
ByteString
)]]
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
import
Data.Either
-- | Use case
--
>>>
:{
-- :{
-- wikimediaFile <- BL.readFile "text.xml"
-- _ <- runConduit $ parseLBS def wikimediaFile
-- .| 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