Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Julien Moutinho
haskell-gargantext
Commits
ecf21781
Commit
ecf21781
authored
Oct 29, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[API][NGRAMS-TABLE] WIP for meeting (adding file).
parent
1a307666
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
0 deletions
+60
-0
Ngrams.hs
src/Gargantext/API/Ngrams.hs
+60
-0
No files found.
src/Gargantext/API/Ngrams.hs
0 → 100644
View file @
ecf21781
{-|
Module : Gargantext.API.Ngrams
Description : Server API
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
Ngrams API
-- | TODO
-- get data of NgramsTable
-- post :: update NodeNodeNgrams
-- group ngrams
get ngrams filtered by NgramsType
add get
-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FlexibleInstances #-}
module
Gargantext.API.Ngrams
where
import
GHC.Generics
(
Generic
)
import
Data.Aeson
(
FromJSON
,
ToJSON
)
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Text
(
Text
)
import
Gargantext.Prelude
import
Gargantext.Core.Types.Main
(
Tree
(
..
))
import
Gargantext.Core.Utils.Prefix
(
unPrefix
)
import
Gargantext.Core.Types
(
ListType
(
..
))
data
NgramsTree
=
NgramsTree
{
_nn_ngrams
::
Text
,
_nn_id
::
Int
,
_nn_list
::
ListType
}
$
(
deriveJSON
(
unPrefix
"_nn_"
)
''
N
gramsTree
)
data
NgramsTable
=
NgramsTable
{
_ngramsTable
::
[
Tree
NgramsTree
]
}
deriving
(
Generic
)
instance
ToJSON
NgramsTable
instance
FromJSON
NgramsTable
instance
FromJSON
(
Tree
NgramsTree
)
-- TODO
instance
ToJSON
(
Tree
NgramsTree
)
-------------------------------------------------------------------
-------------------------------------------------------------------
-------------------------------------------------------------------
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment