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
12 module Gargantext.Core
15 import Gargantext.Prelude
16 import GHC.Generics (Generic)
18 import Data.Either(Either(Left))
22 ------------------------------------------------------------------------
23 -- | Language of a Text
24 -- For simplicity, we suppose text has an homogenous language
26 -- Next steps: | DE | IT | SP
30 -- - DE == deutch (not implemented yet)
31 -- - IT == italian (not implemented yet)
32 -- - SP == spanish (not implemented yet)
34 -- ... add your language and help us to implement it (:
36 -- | All languages supported
37 -- TODO : DE | SP | CH
38 data Lang = EN | FR | All
39 deriving (Show, Eq, Ord, Bounded, Enum, Generic)
42 instance FromJSON Lang
43 instance ToSchema Lang
44 instance FromHttpApiData Lang
46 parseUrlPiece "EN" = pure EN
47 parseUrlPiece "FR" = pure FR
48 parseUrlPiece "All" = pure All
49 parseUrlPiece _ = Left "Unexpected value of OrderBy"
51 allLangs = [minBound ..]
57 instance HasDBid Lang where
65 fromDBid _ = panic "HasDBid lang, not implemented"
68 ------------------------------------------------------------------------
69 data PostTagAlgo = CoreNLP
72 instance HasDBid PostTagAlgo where
75 fromDBid _ = panic "HasDBid posTagAlgo : Not implemented"