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
context2phyloDocument timeUnit context (ngs_terms, ngs_sources) = do
let contextId = _context_id context
(date, date') <- context2date context timeUnit
text <- Map.lookup contextId ngs_terms
sources <- Map.lookup contextId ngs_sources
pure $ Document date date'
(toText text)
Nothing
(toText sources)
where
toText x = Set.toList $ Set.map unNgramsTerm x
let
toText x = Set.toList $ Set.map unNgramsTerm x
text' = maybe [] toText $ Map.lookup contextId ngs_terms
sources' = maybe [] toText $ Map.lookup contextId ngs_sources
pure $ Document date date' text' Nothing sources'
context2date :: Context HyperdataDocument -> TimeUnit -> Maybe (Date, Text)
......
......@@ -140,7 +140,7 @@ periodsToYears periods = (Set.fromList . sort . concat)
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 =
let dates' = sort 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