]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Text/Terms/Multi/Lang/Fr.hs
Merge remote-tracking branch 'origin/dev-ngrams-table' into dev
[gargantext.git] / src / Gargantext / Text / Terms / Multi / Lang / Fr.hs
1 {-|
2 Module : Gargantext.Text.Terms.Multi.Lang.Fr
3 Description : French Grammar rules to group postag tokens.
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
8 Portability : POSIX
9
10 This @group@ function groups horizontally ngrams in their context of
11 sentence according to grammars specific of each language. In english, JJ
12 is ADJectiv in french.
13
14 -}
15
16 {-# LANGUAGE NoImplicitPrelude #-}
17 {-# LANGUAGE OverloadedStrings #-}
18
19 module Gargantext.Text.Terms.Multi.Lang.Fr (group)
20 where
21
22 import Gargantext.Prelude
23 import Gargantext.Core.Types
24 import Gargantext.Text.Terms.Multi.Group (group2)
25
26 group :: [TokenTag] -> [TokenTag]
27 group [] = []
28 group ntags = group2 NP NP
29 $ group2 NP VB
30 $ group2 NP IN
31 -- - $ group2 IN DT
32 $ group2 VB NP
33 $ group2 JJ NP
34 $ group2 NP JJ
35 $ group2 JJ JJ
36 -- - $ group2 JJ CC
37 $ ntags
38
39 ------------------------------------------------------------------------
40 -- TODO
41 --groupNgrams ((x,_,"PERSON"):(y,yy,"PERSON"):xs) = groupNgrams ((x <> " " <> y,yy,"PERSON"):xs)
42 --groupNgrams ((x,_,"ORGANIZATION"):(y,yy,"ORGANIZATION"):xs) = groupNgrams ((x <> " " <> y,yy,"ORGANIZATION"):xs)