Commit 00344aaf authored by Alexandre Delanoë's avatar Alexandre Delanoë

[TERMS] adding type MonoMulti.

parent a5bcf8db
...@@ -42,16 +42,23 @@ import Gargantext.Core.Types ...@@ -42,16 +42,23 @@ import Gargantext.Core.Types
import Gargantext.Text.Terms.Multi (multiterms) import Gargantext.Text.Terms.Multi (multiterms)
import Gargantext.Text.Terms.Mono (monoterms') import Gargantext.Text.Terms.Mono (monoterms')
data TermType = Mono | Multi data TermType = Mono | Multi | MonoMulti
-- remove Stop Words -- remove Stop Words
-- map (filter (\t -> not . elem t)) $ -- map (filter (\t -> not . elem t)) $
------------------------------------------------------------------------ ------------------------------------------------------------------------
-- | Sugar to extract terms from text (hiddeng mapM from end user).
extractTerms :: Traversable t => TermType -> Lang -> t Text -> IO (t [Terms]) extractTerms :: Traversable t => TermType -> Lang -> t Text -> IO (t [Terms])
extractTerms termType lang = mapM (terms termType lang) extractTerms termType lang = mapM (terms termType lang)
------------------------------------------------------------------------ ------------------------------------------------------------------------
-- | Terms from Text
-- Mono : mono terms
-- Multi : multi terms
-- MonoMulti : mono and multi
-- TODO : multi terms should exclude mono (intersection is not empty yet)
terms :: TermType -> Lang -> Text -> IO [Terms] terms :: TermType -> Lang -> Text -> IO [Terms]
terms Mono lang txt = pure $ monoterms' lang txt terms Mono lang txt = pure $ monoterms' lang txt
terms Multi lang txt = multiterms lang txt terms Multi lang txt = multiterms lang txt
terms MonoMulti lang txt = terms Multi lang txt
------------------------------------------------------------------------ ------------------------------------------------------------------------
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment