Commit ff6d1d32 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[ngrams] some debugging info

parent ca606da8
...@@ -327,8 +327,8 @@ commitStatePatch listId (Versioned _p_version p) = do ...@@ -327,8 +327,8 @@ commitStatePatch listId (Versioned _p_version p) = do
assertValid $ transformable p q assertValid $ transformable p q
assertValid $ applicable p' (r ^. r_state) assertValid $ applicable p' (r ^. r_state)
-} -}
printDebug "[commitStatePatch] a version" (a ^. a_version) -- printDebug "[commitStatePatch] a version" (a ^. a_version)
printDebug "[commitStatePatch] a' version" (a' ^. a_version) -- printDebug "[commitStatePatch] a' version" (a' ^. a_version)
pure ( ns & unNodeStory . at listId .~ (Just a') pure ( ns & unNodeStory . at listId .~ (Just a')
, Versioned (a' ^. a_version) q' , Versioned (a' ^. a_version) q'
) )
...@@ -637,15 +637,16 @@ setNgramsTableScores :: forall env err m t. ...@@ -637,15 +637,16 @@ setNgramsTableScores :: forall env err m t.
-> t -> t
-> m t -> m t
setNgramsTableScores nId listId ngramsType table = do setNgramsTableScores nId listId ngramsType table = do
let ngrams_terms = table ^.. each . ne_ngrams
-- printDebug "ngrams_terms" ngrams_terms
t1 <- getTime t1 <- getTime
occurrences <- getOccByNgramsOnlyFast nId listId ngramsType occurrences <- getOccByNgramsOnlyFast nId listId ngramsType
--printDebug "occurrences" occurrences printDebug "[setNgramsTableScores] occurrences" occurrences
t2 <- getTime t2 <- getTime
liftBase $ hprint stderr liftBase $ do
("getTableNgrams/setScores #ngrams=" % int % " time=" % hasTime % "\n") let ngrams_terms = table ^.. each . ne_ngrams
(length ngrams_terms) t1 t2 -- printDebug "ngrams_terms" ngrams_terms
hprint stderr
("getTableNgrams/setScores #ngrams=" % int % " time=" % hasTime % "\n")
(length ngrams_terms) t1 t2
let let
setOcc ne = ne & ne_occurrences .~ sumOf (at (ne ^. ne_ngrams) . _Just) occurrences setOcc ne = ne & ne_occurrences .~ sumOf (at (ne ^. ne_ngrams) . _Just) occurrences
......
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