2 Module : Gargantext.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.
15 {-# LANGUAGE NoImplicitPrelude #-}
16 {-# LANGUAGE OverloadedStrings #-}
18 module Gargantext.Text.Terms.Multi.Lang.En (group)
21 import Gargantext.Prelude
22 import Gargantext.Core.Types
23 import Gargantext.Text.Terms.Multi.Group
25 ------------------------------------------------------------------------
26 -- | Rule grammar to group tokens
27 group :: [TokenTag] -> [TokenTag]
29 group ntags = group2 NP NP
39 ------------------------------------------------------------------------
40 --groupNgrams ((x,_,"PERSON"):(y,yy,"PERSON"):xs) = groupNgrams ((x <> " " <> y,yy,"PERSON"):xs)
41 --groupNgrams ((x,_,"ORGANIZATION"):(y,yy,"ORGANIZATION"):xs) = groupNgrams ((x <> " " <> y,yy,"ORGANIZATION"):xs)
42 --groupNgrams ((x,_,"LOCATION"):(y,yy,"LOCATION"):xs) = groupNgrams ((x <> " " <> y,yy,"LOCATION"):xs)
44 --groupNgrams (x:xs) = (x:(groupNgrams xs))