Commit 063e67d0 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[Clean]

parent 07225081
...@@ -63,7 +63,8 @@ ngramsGroup :: GroupParams ...@@ -63,7 +63,8 @@ ngramsGroup :: GroupParams
-> Text -> Text
-> Text -> Text
ngramsGroup GroupIdentity = identity ngramsGroup GroupIdentity = identity
ngramsGroup (GroupParams l _m _n _) = Text.intercalate " " ngramsGroup (GroupParams l _m _n _) =
Text.intercalate " "
. map (stem l) . map (stem l)
-- . take n -- . take n
. List.sort . List.sort
...@@ -79,10 +80,10 @@ mergeMapParent = undefined ...@@ -79,10 +80,10 @@ mergeMapParent = undefined
------------------------------------------------------------------------ ------------------------------------------------------------------------
toGroupedText :: Ord b toGroupedText :: Ord b
=> (Text -> Text) => (Text -> Text )
-> (a -> b) -> (a -> b )
-> (a -> Set Text) -> (a -> Set Text )
-> (a -> Set NodeId) -> (a -> Set NodeId)
-> [(Text,a)] -> [(Text,a)]
-> Map Stem (GroupedText b) -> Map Stem (GroupedText b)
toGroupedText fun_stem fun_score fun_texts fun_nodeIds from = groupStems' $ map group from toGroupedText fun_stem fun_score fun_texts fun_nodeIds from = groupStems' $ map group from
...@@ -152,5 +153,3 @@ addListType m g = set gt_listType (hasListType m g) g ...@@ -152,5 +153,3 @@ addListType m g = set gt_listType (hasListType m g) g
$ map (\t -> Map.lookup t m') $ map (\t -> Map.lookup t m')
$ Set.toList $ Set.toList
$ Set.insert label g' $ Set.insert label g'
...@@ -58,8 +58,8 @@ buildNgramsLists :: ( RepoCmdM env err m ...@@ -58,8 +58,8 @@ buildNgramsLists :: ( RepoCmdM env err m
buildNgramsLists user gp uCid mCid = do buildNgramsLists user gp uCid mCid = do
ngTerms <- buildNgramsTermsList user uCid mCid gp ngTerms <- buildNgramsTermsList user uCid mCid gp
othersTerms <- mapM (buildNgramsOthersList user uCid (ngramsGroup GroupIdentity)) othersTerms <- mapM (buildNgramsOthersList user uCid (ngramsGroup GroupIdentity))
[ (Authors, MapListSize 9) [ (Authors , MapListSize 9)
, (Sources, MapListSize 9) , (Sources , MapListSize 9)
, (Institutes, MapListSize 9) , (Institutes, MapListSize 9)
] ]
...@@ -83,7 +83,8 @@ buildNgramsOthersList user uCid groupIt (nt, MapListSize mapListSize) = do ...@@ -83,7 +83,8 @@ buildNgramsOthersList user uCid groupIt (nt, MapListSize mapListSize) = do
ngs <- groupNodesByNgramsWith groupIt <$> getNodesByNgramsUser uCid nt ngs <- groupNodesByNgramsWith groupIt <$> getNodesByNgramsUser uCid nt
let let
grouped = toGroupedText groupIt (Set.size . snd) fst snd (Map.toList $ Map.mapWithKey (\k (a,b) -> (Set.delete k a, b)) $ ngs) grouped = toGroupedText groupIt (Set.size . snd) fst snd
(Map.toList $ Map.mapWithKey (\k (a,b) -> (Set.delete k a, b)) $ ngs)
socialLists <- flowSocialList user nt (Set.fromList $ Map.keys ngs) socialLists <- flowSocialList user nt (Set.fromList $ Map.keys ngs)
......
...@@ -57,7 +57,6 @@ flowSocialList user nt ngrams' = do ...@@ -57,7 +57,6 @@ flowSocialList user nt ngrams' = do
-- printDebug "* socialLists *: results \n" result -- printDebug "* socialLists *: results \n" result
pure result pure result
------------------------------------------------------------------------ ------------------------------------------------------------------------
unions :: (Ord a, Semigroup a, Semigroup b, Ord b) unions :: (Ord a, Semigroup a, Semigroup b, Ord b)
=> [Map a (Set b)] -> Map a (Set b) => [Map a (Set b)] -> Map a (Set b)
......
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