Commit 102c7369 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FEAT] default basic list

parent fd80a797
......@@ -142,10 +142,10 @@ buildNgramsTermsList l n m s uCid mCid = do
candidates <- sortTficf <$> getTficf uCid mCid NgramsTerms (ngramsGroup l n m)
let
candidatesSize = 2000
candidatesSize = 1000
a = 10
b = 10
a = 50
b = 50
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment