import Gargantext.Database.Prelude (runPGSQuery{-, formatPGSQuery-})
import Gargantext.API.Ngrams.Types (TabType(..), ngramsTypeFromTabType, NgramsTerm(..))
import Gargantext.Core.Mail.Types (HasMail)
-import Gargantext.Core.NodeStory
+import Gargantext.Core.NodeStory hiding (runPGSQuery)
import Gargantext.Core.Text.Metrics (scored, Scored(..), {-localMetrics, toScored-})
import Database.PostgreSQL.Simple.ToField (toField, Action{-, ToField-})
import Gargantext.Core.Types (ListType(..), Limit, NodeType(..), ContextId)
updateNgramsOccurrences' :: (FlowCmdM env err m)
- => CorpusId -> Maybe ListId -> Maybe Limit -> TabType
+ => CorpusId -> Maybe ListId -> Maybe Limit -> TabType
-> m [Int]
updateNgramsOccurrences' cId maybeListId maybeLimit tabType = do
Just lId' -> pure lId'
result <- getNgramsOccurrences cId lId tabType maybeLimit
-
+
let
toInsert :: [[Action]]
toInsert = map (\(ngramsTerm, score)
RETURNING 1
|]
- let fields = map (\t-> QualifiedIdentifier Nothing t)
+ let fields = map (\t-> QualifiedIdentifier Nothing t)
$ map Text.pack ["int4", "int4","text","int4","int4"]
map (\(Only a) -> a) <$> runPGSQuery queryInsert (Only $ Values fields toInsert)
Just lId' -> pure lId'
result <- getContextsNgramsScore cId lId Terms MapTerm Nothing
-
+
let
toInsert :: [[Action]]
toInsert = map (\(contextId, score)
RETURNING 1
|]
- let fields = map (\t-> QualifiedIdentifier Nothing t)
+ let fields = map (\t-> QualifiedIdentifier Nothing t)
$ map Text.pack ["int4", "int4","int4"]
map (\(Only a) -> a) <$> runPGSQuery queryInsert (Only $ Values fields toInsert)
take' :: Maybe Int -> [a] -> [a]
take' Nothing xs = xs
take' (Just n) xs = take n xs
-
-
-