]> Git — Sourcephile - gargantext.git/blob - src-test/Ngrams/NLP.hs
Add JSON roundtrip tests for Datafield and WithQuery
[gargantext.git] / src-test / Ngrams / NLP.hs
1
2 {-|
3 Module : Ngrams.NLP
4 Description :
5 Copyright : (c) CNRS, 2017-Present
6 License : AGPL + CECILL v3
7 Maintainer : team@gargantext.org
8 Stability : experimental
9 Portability : POSIX
10
11 -}
12
13
14 module Ngrams.NLP where
15
16 import Data.Text (Text)
17 import Test.Hspec
18 import Gargantext.Prelude
19 import Gargantext.Core.Text.Terms.Multi
20
21
22 test :: Spec
23 test = do
24 describe "Text that should be cleaned before sending it to NLP tools as micro-services." $ do
25 let text = "This is a url http://cnrs.gargantext.org to be remove and another one www.gargantext.org and digits 343242-2332 to be remove and some to keep: 232 231 33." :: Text
26 let result = "This is a url to be remove and another one and digits to be remove and some to keep: 232 231 33."
27 it "NLP Clean Text before sending to micro services:" $ cleanTextForNLP text `shouldBe` result
28