]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Core.hs
[FIX] Markdown
[gargantext.git] / src / Gargantext / Core.hs
1 {-|
2 Module : Gargantext.Core
3 Description : Supported Natural language
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
8 Portability : POSIX
9
10 -}
11
12 {-# LANGUAGE NoImplicitPrelude #-}
13 {-# LANGUAGE DeriveGeneric #-}
14 {-# LANGUAGE TemplateHaskell #-}
15
16 module Gargantext.Core
17 where
18
19 import Gargantext.Prelude
20 import GHC.Generics (Generic)
21 import Data.Aeson
22 import Data.Swagger
23 ------------------------------------------------------------------------
24 -- | Language of a Text
25 -- For simplicity, we suppose text has an homogenous language
26 --
27 -- Next steps: | DE | IT | SP
28 --
29 -- - EN == english
30 -- - FR == french
31 -- - DE == deutch (not implemented yet)
32 -- - IT == italian (not implemented yet)
33 -- - SP == spanish (not implemented yet)
34 --
35 -- ... add your language and help us to implement it (:
36
37 -- | All languages supported
38 -- TODO : DE | SP | CH
39 data Lang = EN | FR
40 deriving (Show, Eq, Ord, Bounded, Enum, Generic)
41
42 instance ToJSON Lang
43 instance FromJSON Lang
44 instance ToSchema Lang
45
46 allLangs :: [Lang]
47 allLangs = [minBound ..]