]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Text/Corpus/API.hs
ready for quality score
[gargantext.git] / src / Gargantext / Text / Corpus / API.hs
1 {-|
2 Module : Gargantext.Text.Corpus.API
3 Description : All crawlers of Gargantext in one file.
4 Copyright : (c) CNRS, 2017
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
8 Portability : POSIX
9
10 -}
11
12 {-# LANGUAGE NoImplicitPrelude #-}
13 {-# LANGUAGE OverloadedStrings #-}
14 {-# LANGUAGE DeriveGeneric #-}
15
16 module Gargantext.Text.Corpus.API
17 where
18
19 --{-
20
21 import GHC.Generics (Generic)
22 import Data.Aeson
23 import Data.Text (Text)
24 import Gargantext.Prelude
25 --import qualified PUBMED as PubMed
26 import Test.QuickCheck.Arbitrary
27 import Test.QuickCheck (elements)
28 import Data.Swagger
29 --import qualified Gargantext.Text.Corpus.API.Isidore as Isidore
30
31
32 data ExternalAPIs = ALL
33 | PubMed
34 | HAL
35 | IsTex
36 | IsidoreQuery | IsidoreAuth
37 deriving (Show, Eq, Enum, Bounded, Generic)
38
39 instance FromJSON ExternalAPIs
40 instance ToJSON ExternalAPIs
41 type Query = Text
42
43 externalAPIs :: [ExternalAPIs]
44 externalAPIs = [minBound..maxBound]
45
46 instance Arbitrary ExternalAPIs
47 where
48 arbitrary = elements externalAPIs
49
50 instance ToSchema ExternalAPIs
51 {-
52 crawl :: Crawler -> Query -> IO [PubMed.Doc]
53 crawl Pubmed = PubMed.crawler
54 --}