[ngrams] fix grouping to use mapListSize

parent dd95bc6c
Pipeline #5886 passed with stages
in 84 minutes and 34 seconds
......@@ -164,7 +164,7 @@ buildNgramsTermsList :: ( HasNodeError err
-> GroupParams
-> (NgramsType, MapListSize)
-> m (Map NgramsType [NgramsElement])
buildNgramsTermsList user uCid mCid mfslw groupParams (nt, MapListSize _mapListSize) = do
buildNgramsTermsList user uCid mCid mfslw groupParams (nt, MapListSize mapListSize) = do
-- Filter 0 With Double
-- Computing global speGen score
......@@ -184,25 +184,24 @@ buildNgramsTermsList user uCid mCid mfslw groupParams (nt, MapListSize _mapListS
)
-- printDebug "[buildNgramsTermsList: Flow Social List / end]" nt
-- let !ngramsKeys = HashSet.fromList
-- $ List.take mapListSize
-- $ HashSet.toList
-- $ HashMap.keysSet allTerms
let !ngramsKeys = HashMap.keysSet allTerms
let !allKeys = HashMap.keysSet allTerms
-- printDebug "[buildNgramsTermsList: ngramsKeys]" (HashSet.size ngramsKeys)
!groupParams' <- getGroupParams groupParams (HashSet.map (text2ngrams . unNgramsTerm) ngramsKeys)
!groupParams' <- getGroupParams groupParams (HashSet.map (text2ngrams . unNgramsTerm) allKeys)
let
!socialLists_Stemmed = addScoreStem groupParams' ngramsKeys socialLists
!socialLists_Stemmed = addScoreStem groupParams' allKeys socialLists
!groupedWithList = toGroupedTree socialLists_Stemmed allTerms
!(stopTerms, candidateTerms) = HashMap.partition ((== Just StopTerm) . viewListType)
$ HashMap.fromList
$ List.take mapListSize
$ HashMap.toList
$ HashMap.filter (\g -> view gts'_score g > 1)
$ view flc_scores groupedWithList
-- | Split candidateTerms into mono-terms and multi-terms.
!(groupedMono, groupedMult) = HashMap.partitionWithKey (\(NgramsTerm t) _v -> size t < 2) candidateTerms
!(groupedMono, groupedMult) = HashMap.partitionWithKey (\(NgramsTerm t) _v -> size t < 2) candidateTerms
-- void $ panicTrace $ "groupedWithList: " <> show groupedWithList
......
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