Commit cbcf903c authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] Phylo Document list

parent 109d8b9e
Pipeline #2554 failed with stage
in 43 minutes and 58 seconds
...@@ -121,14 +121,14 @@ context2phyloDocument :: TimeUnit ...@@ -121,14 +121,14 @@ context2phyloDocument :: TimeUnit
context2phyloDocument timeUnit context (ngs_terms, ngs_sources) = do context2phyloDocument timeUnit context (ngs_terms, ngs_sources) = do
let contextId = _context_id context let contextId = _context_id context
(date, date') <- context2date context timeUnit (date, date') <- context2date context timeUnit
text <- Map.lookup contextId ngs_terms
sources <- Map.lookup contextId ngs_sources let
pure $ Document date date' toText x = Set.toList $ Set.map unNgramsTerm x
(toText text)
Nothing text' = maybe [] toText $ Map.lookup contextId ngs_terms
(toText sources) sources' = maybe [] toText $ Map.lookup contextId ngs_sources
where
toText x = Set.toList $ Set.map unNgramsTerm x pure $ Document date date' text' Nothing sources'
context2date :: Context HyperdataDocument -> TimeUnit -> Maybe (Date, Text) context2date :: Context HyperdataDocument -> TimeUnit -> Maybe (Date, Text)
......
...@@ -140,7 +140,7 @@ periodsToYears periods = (Set.fromList . sort . concat) ...@@ -140,7 +140,7 @@ periodsToYears periods = (Set.fromList . sort . concat)
findBounds :: [Date] -> (Date,Date) findBounds :: [Date] -> (Date,Date)
findBounds [] = panic "[G.C.V.P.PhyloTools] nod Dates for find bounds" findBounds [] = panic "[G.C.V.P.PhyloTools] empty dates for find bounds"
findBounds dates = findBounds dates =
let dates' = sort dates let dates' = sort dates
in (head' "findBounds" dates', last' "findBounds" dates') in (head' "findBounds" dates', last' "findBounds" dates')
......
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