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
72c29d93
Commit
72c29d93
authored
May 03, 2021
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] removing printDebug
parent
d4e1dd93
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
List.hs
src/Gargantext/API/Ngrams/List.hs
+8
-4
No files found.
src/Gargantext/API/Ngrams/List.hs
View file @
72c29d93
...
@@ -117,20 +117,24 @@ reIndexWith cId lId nt lts = do
...
@@ -117,20 +117,24 @@ reIndexWith cId lId nt lts = do
<$>
HashMap
.
toList
<$>
HashMap
.
toList
<$>
getTermsWith
identity
[
lId
]
nt
lts
<$>
getTermsWith
identity
[
lId
]
nt
lts
--printDebug "ts" ts
--
printDebug "ts" ts
-- Taking the ngrams with 0 occurrences only (orphans)
-- Taking the ngrams with 0 occurrences only (orphans)
occs
<-
getOccByNgramsOnlyFast'
cId
lId
nt
ts
occs
<-
getOccByNgramsOnlyFast'
cId
lId
nt
ts
-- printDebug "occs" occs
let
orphans
=
List
.
concat
let
orphans
=
List
.
concat
$
map
(
\
t
->
case
HashMap
.
lookup
t
occs
of
$
map
(
\
t
->
case
HashMap
.
lookup
t
occs
of
Nothing
->
[
t
]
Nothing
->
[
t
]
Just
n
->
if
n
=
=
1
then
[
t
]
else
[ ]
Just
n
->
if
n
<
=
1
then
[
t
]
else
[ ]
)
ts
)
ts
-- printDebug "orphans" orphans
-- Get all documents of the corpus
-- Get all documents of the corpus
docs
<-
selectDocNodes
cId
docs
<-
selectDocNodes
cId
-- printDebug "docs length" (List.length docs)
-- Checking Text documents where orphans match
-- Checking Text documents where orphans match
-- TODO Tests here
-- TODO Tests here
...
@@ -147,7 +151,7 @@ reIndexWith cId lId nt lts = do
...
@@ -147,7 +151,7 @@ reIndexWith cId lId nt lts = do
(
List
.
cycle
[
Map
.
fromList
$
[(
nt
,
Map
.
singleton
(
doc
^.
node_id
)
1
)]])
(
List
.
cycle
[
Map
.
fromList
$
[(
nt
,
Map
.
singleton
(
doc
^.
node_id
)
1
)]])
)
docs
)
docs
printDebug
"ngramsByDoc"
ngramsByDoc
--
printDebug "ngramsByDoc" ngramsByDoc
-- Saving the indexation in database
-- Saving the indexation in database
_
<-
mapM
(
saveDocNgramsWith
lId
)
ngramsByDoc
_
<-
mapM
(
saveDocNgramsWith
lId
)
ngramsByDoc
...
...
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