Copyright | (c) CNRS 2017-Present |
---|---|
License | AGPL + CECILL v3 |
Maintainer | team@gargantext.org |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
TODO use Opaleye for the queries.
Synopsis
- data NgramsPostag = NgramsPostag {
- _np_lang :: !Lang
- _np_algo :: !PosTagAlgo
- _np_postag :: !POS
- _np_form :: !Ngrams
- _np_lem :: !Ngrams
- np_postag :: Lens' NgramsPostag POS
- np_lem :: Lens' NgramsPostag Ngrams
- np_lang :: Lens' NgramsPostag Lang
- np_form :: Lens' NgramsPostag Ngrams
- np_algo :: Lens' NgramsPostag PosTagAlgo
- type NgramsPostagInsert = (Int, Int, Text, Text, Int, Text, Int)
- toInsert :: NgramsPostag -> NgramsPostagInsert
- insertNgramsPostag :: [NgramsPostag] -> DBCmd err (HashMap Text NgramsId)
- insertNgramsPostag' :: [NgramsPostagInsert] -> DBCmd err [Indexed Text Int]
- queryInsertNgramsPostag :: Query
- selectLems :: Lang -> NLPServerConfig -> [Ngrams] -> DBCmd err [(Form, Lem)]
- querySelectLems :: Query
- createTable_NgramsPostag :: DBCmd err [Int]
Documentation
data NgramsPostag #
NgramsPostag | |
|
Instances
insertNgramsPostag :: [NgramsPostag] -> DBCmd err (HashMap Text NgramsId) #
insertNgramsPostag' :: [NgramsPostagInsert] -> DBCmd err [Indexed Text Int] #
selectLems :: Lang -> NLPServerConfig -> [Ngrams] -> DBCmd err [(Form, Lem)] #
createTable_NgramsPostag :: DBCmd err [Int] #
This is the same as selectLems
, but slower.
selectLems' :: Lang -> NLPServerConfig -> [Ngrams] -> DBCmd err [(Form, Lem)]
selectLems' l (NLPServerConfig { server }) ns = runPGSQuery querySelectLems' (PGS.Only $ Values fields datas)
where
fields = map (QualifiedIdentifier Nothing) ["int4","int4","text", "int4"]
datas = map (d -> [toField $ toDBid l, toField $ toDBid server] <> toRow d) ns
Insert Table