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

[BOARD] enabling it in the Tree + cosmetics.

parent ce9814b9
......@@ -1044,14 +1044,14 @@ getTableNgrams _nType nId tabType listId limit_ offset
-- 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
......@@ -1059,7 +1059,7 @@ getTableNgrams _nType nId tabType listId limit_ offset
% " 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
......
......@@ -174,17 +174,17 @@ getOccByNgramsOnlyFast' cId lId nt tms = trace (show (cId, lId)) $
where
fields = [QualifiedIdentifier Nothing "text"]
run :: CorpusId
-> ListId
-> NgramsType
-> [Text]
-> Cmd err [(Text, Double)]
run cId' lId' _nt' tms' = runPGSQuery query
run cId' lId' nt' tms' = runPGSQuery query
( Values fields (DPS.Only <$> tms')
, cId'
, lId'
-- , ngramsTypeId nt'
, ngramsTypeId nt'
)
query :: DPS.Query
......@@ -193,10 +193,10 @@ getOccByNgramsOnlyFast' cId lId nt tms = trace (show (cId, lId)) $
SELECT ng.terms, nng.weight FROM node_node_ngrams nng
JOIN ngrams ng ON nng.ngrams_id = ng.id
JOIN input_rows ir ON ir.terms = ng.terms
WHERE nng.node1_id = ? -- CorpusId
AND nng.node2_id = ?
-- AND nng.ngrams_type = ? -- NgramsTypeId
-- AND nn.category > 0
WHERE nng.node1_id = ? -- CorpusId
AND nng.node2_id = ? -- ListId
AND nng.ngrams_type = ? -- NgramsTypeId
-- AND nn.category > 0 -- TODO
GROUP BY ng.terms, nng.weight
|]
......
......@@ -108,7 +108,7 @@ dbTree rootId = map (\(nId, tId, pId, n) -> DbTreeNode nId tId pId n)
FROM nodes AS c
INNER JOIN tree AS s ON c.parent_id = s.id
WHERE c.typename IN (2,20,21,22,3,5,30,31,40,7,9,90)
WHERE c.typename IN (2,20,21,22,3,5,30,31,40,7,9,90,71)
)
SELECT * from tree;
|] (Only rootId)
......
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