Commit 23ef92fa authored by Alexandre Delanoë's avatar Alexandre Delanoë

[TextFlow] map list acceptable for tests (WIP)

parent e16a2824
Pipeline #1048 canceled with stage
...@@ -99,17 +99,17 @@ buildNgramsTermsList :: Lang ...@@ -99,17 +99,17 @@ buildNgramsTermsList :: Lang
-> MasterCorpusId -> MasterCorpusId
-> Cmd err (Map NgramsType [NgramsElement]) -> Cmd err (Map NgramsType [NgramsElement])
buildNgramsTermsList _l _n _m s uCid mCid = do buildNgramsTermsList _l _n _m s uCid mCid = do
candidates <- sortTficf Down <$> getTficf uCid mCid NgramsTerms candidates <- sortTficf Up <$> getTficf uCid mCid NgramsTerms
printDebug "head candidates" (List.take 10 $ candidates) printDebug "head candidates" (List.take 10 $ candidates)
printDebug "tail candidates" (List.take 10 $ List.reverse $ candidates) printDebug "tail candidates" (List.take 10 $ List.reverse $ candidates)
let let
candidatesSize = 400 (candidatesHead, candidatesTail0) = List.splitAt 3 candidates
candidatesHead = List.take candidatesSize candidates (candidatesMap, candidatesTailFinal) = List.splitAt 400 candidatesTail0
candidatesTail = List.drop candidatesSize candidates
termList = (map (toGargList ((isStopTerm s) .fst) MapTerm) candidatesHead) termList = (map (toGargList ((isStopTerm s) . fst) CandidateTerm) candidatesHead)
<> (map (toGargList ((isStopTerm s) .fst) CandidateTerm) candidatesTail) <> (map (toGargList ((isStopTerm s) . fst) MapTerm) candidatesMap)
<> (map (toGargList ((isStopTerm s) . fst) CandidateTerm) candidatesTailFinal)
ngs = List.concat ngs = List.concat
$ map toNgramsElement $ map toNgramsElement
......
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