-}
-{-# LANGUAGE InstanceSigs #-}
-
module Gargantext.Core.Text.Corpus.API
( ExternalAPIs(..)
, Query
import qualified Gargantext.Core.Text.Corpus.API.Istex as ISTEX
import qualified Gargantext.Core.Text.Corpus.API.Pubmed as PUBMED
+-- | TODO put in gargantext.init
+default_limit :: Maybe Integer
+default_limit = Just 10000
+
-- | Get External API metadata main function
get :: ExternalAPIs
-> Lang
-> Query
-> Maybe Limit
-> IO [HyperdataDocument]
-get PubMed _la q l = PUBMED.get q l -- EN only by default
-get HAL la q l = HAL.get la q l
-get IsTex la q l = ISTEX.get la q l
-get Isidore la q l = ISIDORE.get la (fromIntegral <$> l) (Just q) Nothing
+get PubMed _la q _l = PUBMED.get q default_limit -- EN only by default
+get HAL la q _l = HAL.get la q default_limit
+get IsTex la q _l = ISTEX.get la q default_limit
+get Isidore la q _l = ISIDORE.get la (fromIntegral <$> default_limit) (Just q) Nothing
get _ _ _ _ = undefined
-- | Some Sugar for the documentation
type Query = PUBMED.Query
type Limit = PUBMED.Limit
-