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
b56988d8
Unverified
Commit
b56988d8
authored
Jun 11, 2018
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix performance issue due to infinit result of splitEvery
parent
519719a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
7 deletions
+5
-7
CleanCsvCorpus.hs
app/CleanCsvCorpus.hs
+4
-6
Prelude.hs
src/Gargantext/Prelude.hs
+1
-1
No files found.
app/CleanCsvCorpus.hs
View file @
b56988d8
...
...
@@ -42,18 +42,16 @@ main = do
let
q
=
[
"gratuit"
,
"gratuité"
,
"culture"
,
"culturel"
]
(
h
,
csvDocs
)
<-
readCsv
rPath
putStrLn
$
"Number of documents before:"
<>
show
(
V
.
length
csvDocs
)
putStrLn
$
"Mean size of docs:"
<>
show
(
docsSize
csvDocs
)
let
docs
=
toDocs
csvDocs
let
engine
=
insertDocs
docs
initialDocSearchEngine
let
docIds
=
S
.
query
engine
(
map
pack
q
)
let
docs'
=
fromDocs
$
filterDocs
docIds
(
V
.
fromList
docs
)
putStrLn
$
"Number of documents after:"
<>
show
(
V
.
length
docs'
)
putStrLn
$
"Mean size of docs:"
<>
show
(
docsSize
docs'
)
writeCsv
wPath
(
h
,
docs'
)
writeCsv
wPath
(
h
,
docs'
)
src/Gargantext/Prelude.hs
View file @
b56988d8
...
...
@@ -109,7 +109,7 @@ ma = movingAverage 3
-- | splitEvery n == chunkAlong n n
splitEvery
::
Int
->
[
a
]
->
[[
a
]]
splitEvery
_
[]
=
L
.
cycle
[
[]
]
splitEvery
_
[]
=
[
]
splitEvery
n
xs
=
let
(
h
,
t
)
=
L
.
splitAt
n
xs
in
h
:
splitEvery
n
t
...
...
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