2 Module : Gargantext.Core.Text.Terms.Multi.Lang.En
3 Description : English 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
10 Rule-based grammars are computed in this english module in order to group
11 the tokens into extracted terms.
16 module Gargantext.Core.Text.Terms.Multi.Lang.En (groupTokens)
19 import Gargantext.Prelude
20 import Gargantext.Core.Types
21 import Gargantext.Core.Text.Terms.Multi.Group
23 ------------------------------------------------------------------------
24 -- | Rule grammar to group tokens
25 groupTokens :: [TokenTag] -> [TokenTag]
27 groupTokens ntags = group2 NP NP
37 ------------------------------------------------------------------------
38 --groupNgrams ((x,_,"PERSON"):(y,yy,"PERSON"):xs) = groupNgrams ((x <> " " <> y,yy,"PERSON"):xs)
39 --groupNgrams ((x,_,"ORGANIZATION"):(y,yy,"ORGANIZATION"):xs) = groupNgrams ((x <> " " <> y,yy,"ORGANIZATION"):xs)
40 --groupNgrams ((x,_,"LOCATION"):(y,yy,"LOCATION"):xs) = groupNgrams ((x <> " " <> y,yy,"LOCATION"):xs)
42 --groupNgrams (x:xs) = (x:(groupNgrams xs))