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
147
Issues
147
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
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
gargantext
haskell-gargantext
Commits
0d131459
Commit
0d131459
authored
Nov 08, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[API][NGRAMS] Occurrences for ngrams elements.
parent
dc098b15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
Ngrams.hs
src/Gargantext/API/Ngrams.hs
+14
-13
No files found.
src/Gargantext/API/Ngrams.hs
View file @
0d131459
...
...
@@ -84,15 +84,16 @@ instance Arbitrary TabType
------------------------------------------------------------------------
data
NgramsElement
=
NgramsElement
{
_ne_ngrams
::
Text
,
_ne_list
::
ListType
NgramsElement
{
_ne_ngrams
::
Text
,
_ne_list
::
ListType
,
_ne_occurrences
::
Int
}
deriving
(
Ord
,
Eq
,
Show
,
Generic
)
$
(
deriveJSON
(
unPrefix
"_ne_"
)
''
N
gramsElement
)
instance
ToSchema
NgramsElement
instance
Arbitrary
NgramsElement
where
arbitrary
=
elements
[
NgramsElement
"sport"
StopList
]
arbitrary
=
elements
[
NgramsElement
"sport"
StopList
1
]
------------------------------------------------------------------------
data
NgramsTable
=
NgramsTable
{
_ngramsTable
::
[
Tree
NgramsElement
]
}
...
...
@@ -104,17 +105,17 @@ instance Arbitrary NgramsTable where
-- TODO
instance
Arbitrary
(
Tree
NgramsElement
)
where
arbitrary
=
elements
[
TreeN
(
NgramsElement
"animal"
GraphList
)
[
TreeN
(
NgramsElement
"dog"
GraphList
)
[]
,
TreeN
(
NgramsElement
"object"
CandidateList
)
[]
,
TreeN
(
NgramsElement
"cat"
GraphList
)
[]
,
TreeN
(
NgramsElement
"nothing"
StopList
)
[]
arbitrary
=
elements
[
TreeN
(
NgramsElement
"animal"
GraphList
1
)
[
TreeN
(
NgramsElement
"dog"
GraphList
3
)
[]
,
TreeN
(
NgramsElement
"object"
CandidateList
2
)
[]
,
TreeN
(
NgramsElement
"cat"
GraphList
1
)
[]
,
TreeN
(
NgramsElement
"nothing"
StopList
4
)
[]
]
,
TreeN
(
NgramsElement
"plant"
GraphList
)
[
TreeN
(
NgramsElement
"flower"
GraphList
)
[]
,
TreeN
(
NgramsElement
"moon"
CandidateList
)
[]
,
TreeN
(
NgramsElement
"cat"
GraphList
)
[]
,
TreeN
(
NgramsElement
"sky"
StopList
)
[]
,
TreeN
(
NgramsElement
"plant"
GraphList
3
)
[
TreeN
(
NgramsElement
"flower"
GraphList
3
)
[]
,
TreeN
(
NgramsElement
"moon"
CandidateList
1
)
[]
,
TreeN
(
NgramsElement
"cat"
GraphList
2
)
[]
,
TreeN
(
NgramsElement
"sky"
StopList
1
)
[]
]
]
instance
ToSchema
NgramsTable
...
...
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