, NgramsStatePatch
, NgramsTablePatch
- , NgramsElement
+ , NgramsElement(..)
, mkNgramsElement
, mergeNgramsElement
, Repo(..)
, r_version
, r_state
+ , r_history
, NgramsRepo
, NgramsRepoElement(..)
, saveRepo
, _ne_occurrences :: Int
, _ne_root :: Maybe NgramsTerm
, _ne_parent :: Maybe NgramsTerm
- , _ne_children :: MSet NgramsTerm
+ , _ne_children :: MSet NgramsTerm
}
deriving (Ord, Eq, Show, Generic)
-- trace (show lists) $
-- getNgramsTableMap ({-lists <>-} listIds) ngramsType
- let nSco = needsScores orderBy
+ let scoresNeeded = needsScores orderBy
tableMap1 <- getNgramsTableMap listId ngramsType
t1 <- getTime'
- tableMap2 <- tableMap1 & v_data %%~ setScores nSco
+ tableMap2 <- tableMap1 & v_data %%~ setScores scoresNeeded
. Map.mapWithKey ngramsElementFromRepo
t2 <- getTime'
tableMap3 <- tableMap2 & v_data %%~ fmap NgramsTable
- . setScores (not nSco)
+ . setScores (not scoresNeeded)
. selectAndPaginate
t3 <- getTime'
liftIO $ hprint stderr
% " map1=" % timeSpecs
% " map2=" % timeSpecs
% " map3=" % timeSpecs
- % " sql=" % (if nSco then "map2" else "map3")
+ % " sql=" % (if scoresNeeded then "map2" else "map3")
% "\n"
) t0 t3 t0 t1 t1 t2 t2 t3
pure tableMap3