]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Text/Ngrams/Stem.hs
[STRUCTURE] Make it simple and clean old code.
[gargantext.git] / src / Gargantext / Text / Ngrams / Stem.hs
1 {-|
2 Module : Gargantext.Text.Ngrams.Stem
3 Description :
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
8 Portability : POSIX
9
10 Here is a longer description of this module, containing some
11 commentary with @some markup@.
12 -}
13
14
15 module Gargantext.Text.Ngrams.Stem
16 where
17
18 import Data.Text (Text)
19 import qualified Data.Text as DT
20 import qualified NLP.Stemmer as N
21
22 import Gargantext.Core (Lang(..))
23
24 -- (stem, Stemmer(..))
25
26 --import Language.Aspell (check, suggest, spellChecker, spellCheckerWithOptions)
27 --import Language.Aspell.Options (ACOption(..))
28
29 stem :: Lang -> Text -> Text
30 stem lang = DT.pack . N.stem lang' . DT.unpack
31 where
32 lang' = case lang of
33 EN -> N.English
34 FR -> N.French
35