Commit 2b96ca23 authored by arturo's avatar arturo

>>> continue

parent 471fbf05
Pipeline #2032 failed with stage
......@@ -279,14 +279,13 @@ setGlobalDependencies w (PhyloDataSet o)
(freq :: Array Int) <- pure $ w .. "freq"
(terms :: Array GlobalTerm) <- pure $ w .. "terms"
void $ for o.groups \(Group g) -> do
for_ o.groups \(Group g) -> do
let
f = g.foundation
l = g.label
log2 "FOUNDATION" f
log2 "LABEL" l
log2 "group" g
-- For each entries in group.foundation array,
-- increment consequently the global window.keys array
......
......@@ -161,7 +161,7 @@ parseGroups epoch
, from : parseNodeDate o.strFrom o.from epoch
, gId : o._gvid
, label : stringedArrayToArray o.lbl
, role : stringedArrayToArray' o.role
, role : stringedArrayToArray_ o.role
, size : parseInt o.support
, source : parseSources o.source
, to : parseNodeDate o.strTo o.to epoch
......@@ -187,9 +187,13 @@ instance Show GlobalTerm where show = genericShow
parseInt :: String -> Int
parseInt s = maybe 0 identity $ Int.fromString s
parseInt' :: Number -> Int
parseInt' n = maybe 0 identity $ Int.fromNumber n
parseFloat :: String -> Number
parseFloat s = maybe 0.0 identity $ Number.fromString s
parseSources :: String -> Array String
parseSources
= String.replace (String.Pattern "[") (String.Replacement "")
......@@ -234,15 +238,30 @@ stringedMaybeToNumber s =
s # String.replace (String.Pattern "Just ") (String.Replacement "")
>>> parseFloat
-- | From "\"user | sentiment analysis\"" :: String
-- |
-- | To ["user", "sentiment analysis"] :: Array String
stringedArrayToArray :: String -> Array String
stringedArrayToArray str
= str # String.length
>>> (\length -> String.splitAt (length - 1) str)
>>> (\{ after } -> String.splitAt 1 after)
>>> (\{ after } -> String.split (String.Pattern "|") after)
>>> (\length -> String.splitAt (length - 1) str)
>>> (\{ before } -> String.splitAt 1 before)
>>> (\{ after } -> String.split (String.Pattern "|") after)
>>> map String.trim
-- | From "\"97 | 257 | 542 | 574 | 577 | 597 | 785\"" :: String
-- |
-- | To [97, 257, 542, 574, 577, 597, 785] :: Array Int
stringedArrayToArray' :: String -> Array Int
stringedArrayToArray'
= stringedArrayToArray
>>> map parseInt
-- | From "\"3.0 | 3.0 | 3.0 | 3.0 | 1.0 | 3.0 | 3.0\"" :: String
-- |
-- | To [3, 3, 3, 3, 1, 3, 3] :: Array Int
stringedArrayToArray_ :: String -> Array Int
stringedArrayToArray_
= stringedArrayToArray
>>> map parseFloat
>>> map parseInt'
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