3 Description : Gargantext Import Corpus
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
10 Import a corpus binary.
14 {-# LANGUAGE NoImplicitPrelude #-}
15 {-# LANGUAGE OverloadedStrings #-}
16 {-# LANGUAGE FlexibleContexts #-}
17 {-# LANGUAGE Strict #-}
21 import Servant (ServantErr)
22 import Gargantext.Prelude
23 import Gargantext.Database.Flow (flowCorpus)
24 import Gargantext.Text.Parsers (FileFormat(CsvHalFormat))
25 import Gargantext.Database.Utils (Cmd, connectGargandb, runCmdDevWith)
26 import Gargantext.Database.Types.Node (NodeId)
27 --import Gargantext.Database.Schema.User (insertUsers, gargantuaUser, simpleUser)
28 import Gargantext.API.Node () -- instances
29 import Gargantext.API.Ngrams (RepoCmdM)
30 import System.Environment (getArgs)
34 [iniPath, name, corpusPath] <- getArgs
36 {-let createUsers :: Cmd ServantErr Int64
37 createUsers = insertUsers [gargantuaUser,simpleUser]
38 _ <- runCmdDevWith iniPath createUsers
41 {- -- TODO missing repo var...
42 let cmd :: RepoCmdM env ServantErr m => m NodeId
43 cmd = flowCorpus CsvHalFormat corpusPath (cs name)
44 r <- runCmdDevWith iniPath cmd