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
158
Issues
158
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
102c7369
Commit
102c7369
authored
Apr 22, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] default basic list
parent
fd80a797
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
16 deletions
+21
-16
List.hs
src/Gargantext/Text/List.hs
+21
-16
No files found.
src/Gargantext/Text/List.hs
View file @
102c7369
...
...
@@ -142,10 +142,10 @@ buildNgramsTermsList l n m s uCid mCid = do
candidates
<-
sortTficf
<$>
getTficf
uCid
mCid
NgramsTerms
(
ngramsGroup
l
n
m
)
let
candidatesSize
=
2
000
candidatesSize
=
1
000
a
=
1
0
b
=
1
0
a
=
5
0
b
=
5
0
candidatesHead
=
List
.
take
candidatesSize
candidates
candidatesTail
=
List
.
drop
candidatesSize
candidates
...
...
@@ -158,6 +158,24 @@ buildNgramsTermsList l n m s uCid mCid = do
pure
$
Map
.
fromList
[(
NgramsTerms
,
ngs
)]
toTermList
::
Int
->
Int
->
(
a
->
Bool
)
->
[
a
]
->
[(
ListType
,
a
)]
toTermList
_
_
_
[]
=
[]
toTermList
a
b
stop
ns
=
-- trace ("computing toTermList") $
map
(
toList
stop
CandidateTerm
)
xs
<>
map
(
toList
stop
GraphTerm
)
ys
<>
toTermList
a
b
stop
zs
where
xs
=
take
a
ns
xz
=
drop
a
ns
ys
=
take
b
xz
zs
=
drop
b
xz
toNgramsElement
::
(
ListType
,
(
Text
,
(
Double
,
Set
Text
)))
->
[
NgramsElement
]
toNgramsElement
(
listType
,
(
_stem
,
(
_score
,
setNgrams
)))
=
case
Set
.
toList
setNgrams
of
...
...
@@ -180,19 +198,6 @@ toList stop l n = case stop n of
False
->
(
l
,
n
)
toTermList
::
Int
->
Int
->
(
a
->
Bool
)
->
[
a
]
->
[(
ListType
,
a
)]
toTermList
_
_
_
[]
=
[]
toTermList
a
b
stop
ns
=
-- trace ("computing toTermList") $
map
(
toList
stop
CandidateTerm
)
xs
<>
map
(
toList
stop
GraphTerm
)
ys
<>
toTermList
a
b
stop
zs
where
xs
=
take
a
ns
ta
=
drop
a
ns
ys
=
take
b
ta
zs
=
drop
b
ta
isStopTerm
::
StopSize
->
Text
->
Bool
isStopTerm
(
StopSize
n
)
x
=
Text
.
length
x
<
n
||
any
isStopChar
(
Text
.
unpack
x
)
...
...
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