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
153
Issues
153
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
8d8f725c
Commit
8d8f725c
authored
Jul 04, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CLI FIX] IntMap.
parent
bfa50733
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
Main.hs
bin/gargantext-cli/Main.hs
+6
-6
No files found.
bin/gargantext-cli/Main.hs
View file @
8d8f725c
...
...
@@ -28,7 +28,7 @@ import qualified Data.Maybe as DMaybe
import
Control.Monad
(
zipWithM
)
import
Control.Monad.IO.Class
import
qualified
Data.
Map.Strict
as
DM
import
qualified
Data.
IntMap
as
DM
import
Data.Map
(
Map
)
import
Data.Text
(
Text
)
...
...
@@ -72,18 +72,18 @@ filterTermsAndCooc patterns ts = coocOn identity <$> mapM (terms patterns) ts
main
=
do
[
corpusFile
,
termListFile
,
_
]
<-
getArgs
--
corpus :: [Text]
corpus
<-
foldl'
(
\
m
e
->
DM
.
insertWith
(
\
_
x
->
(
snd
e
)
<>
x
)
(
fst
e
)
[]
m
)
DM
.
empty
--
corpus :: IO (DM.IntMap [[Text]])
corpus
<-
DM
.
fromListWith
(
<>
)
<$>
DV
.
toList
<$>
DV
.
map
(
\
n
->
(
csv_publication_year
n
,
[(
csv_title
n
)
<>
" "
<>
(
csv_abstract
n
)]))
<$>
snd
<$>
readCsv
corpusFile
-- termListMap :: [Text]
termList
<-
csvGraphTermList
termListFile
putStrLn
$
show
$
length
termList
let
years
=
DM
.
keys
corpus
let
patterns
=
WithList
$
buildPatterns
termList
let
corpus'
=
DMaybe
.
catMaybes
$
map
(
\
k
->
DM
.
lookup
k
corpus
)
years
...
...
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