Commit c624d176 authored by mzheng's avatar mzheng

formating addGroup

parent 96a23581
......@@ -131,23 +131,26 @@ toGroupedTreeInstitutes'' m notEmpty institutesTree
-> Parent
-> GroupedTreeScores score
-> GroupedTreeScores score
addGroup institutesTree' m' k v =
over gts'_children ( toGroupedTree'' m'
. case HashMap.lookup (unNgramsTerm k) institutesTree' of
Nothing -> HashMap.union ( fromMaybe mempty
$ HashMap.lookup (Just k) m'
)
Just children -> HashMap.union (foldl (\acc child -> HashMap.union acc $
HashMap.singleton
(NgramsTerm child)
GroupedTreeScores
{ _gts'_score= _gts'_score v
, _gts'_listType= _gts'_listType v
, _gts'_children= HashMap.empty
}) HashMap.empty children
)
. HashMap.union ( fromMaybe mempty
$ HashMap.lookup (Just k) m'
)
)
v
\ No newline at end of file
addGroup institutesTree' dict' key val =
over gts'_children
( toGroupedTree'' dict'
. case HashMap.lookup (unNgramsTerm key) institutesTree' of
Nothing -> HashMap.union ( fromMaybe mempty
$ HashMap.lookup (Just key) dict'
)
Just children
-> HashMap.union
(foldl (\acc child
-> HashMap.union acc
$ HashMap.singleton (NgramsTerm child) GroupedTreeScores
{ _gts'_score= _gts'_score val
, _gts'_listType= _gts'_listType val
, _gts'_children= HashMap.empty
}
) HashMap.empty children
)
. HashMap.union ( fromMaybe mempty
$ HashMap.lookup (Just key) dict'
)
)
val
\ No newline at end of file
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