Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Przemyslaw Kaminski
haskell-gargantext
Commits
aad91224
Commit
aad91224
authored
Nov 17, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] build ok.
parent
a6cc37fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
Parsers.hs
src/Gargantext/Text/Parsers.hs
+2
-2
CSV.hs
src/Gargantext/Text/Parsers/CSV.hs
+3
-3
No files found.
src/Gargantext/Text/Parsers.hs
View file @
aad91224
...
...
@@ -107,7 +107,6 @@ parseDate' l (Just txt) = do
toDoc
::
FileFormat
->
[(
Text
,
Text
)]
->
IO
HyperdataDocument
toDoc
WOS
d
=
do
let
abstract
=
lookup
"abstract"
d
let
lang
=
maybe
EN
identity
(
join
$
detectLang
<$>
(
fmap
(
DT
.
take
50
)
abstract
))
...
...
@@ -133,6 +132,7 @@ toDoc WOS d = do
Nothing
Nothing
(
Just
$
(
DT
.
pack
.
show
)
lang
)
toDoc
_
_
=
undefined
parse
::
FileFormat
->
FilePath
->
IO
([
ParseError
],
[[(
Text
,
Text
)]])
parse
format
path
=
do
...
...
@@ -154,7 +154,7 @@ withParser WOS = wosParser
--withParser DOC = docParser
--withParser ODT = odtParser
--withParser XML = xmlParser
--withParser _ = error
"[ERROR] Parser not implemented yet"
withParser
_
=
panic
"[ERROR] Parser not implemented yet"
runParser
::
FileFormat
->
DB
.
ByteString
->
IO
(
Either
String
[[(
DB
.
ByteString
,
DB
.
ByteString
)]])
...
...
src/Gargantext/Text/Parsers/CSV.hs
View file @
aad91224
...
...
@@ -25,7 +25,7 @@ import Control.Applicative
import
Data.Char
(
ord
)
import
Data.Csv
import
Data.Either
(
Either
(
Left
,
Right
))
import
Data.Text
(
Text
,
pack
,
length
,
intercalate
,
unpack
)
import
Data.Text
(
Text
,
pack
,
length
,
intercalate
)
import
qualified
Data.ByteString.Lazy
as
BL
import
Data.Time.Segment
(
jour
)
...
...
@@ -253,7 +253,7 @@ instance FromNamedRecord CsvHal where
<*>
r
.:
"docType_s"
instance
ToNamedRecord
CsvHal
where
toNamedRecord
(
CsvHal
t
s
py
pm
pd
abst
aut
url
isbn
iss
j
our
lang
doi
auth
inst
dept
lab
team
doct
)
=
toNamedRecord
(
CsvHal
t
s
py
pm
pd
abst
aut
url
isbn
iss
j
lang
doi
auth
inst
dept
lab
team
doct
)
=
namedRecord
[
"title"
.=
t
,
"source"
.=
s
...
...
@@ -267,7 +267,7 @@ instance ToNamedRecord CsvHal where
,
"url"
.=
url
,
"isbn_s"
.=
isbn
,
"issue_s"
.=
iss
,
"journalPublisher_s"
.=
j
our
,
"journalPublisher_s"
.=
j
,
"language_s"
.=
lang
,
"doiId_s"
.=
doi
...
...
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