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
159
Issues
159
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
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
52110ac8
Commit
52110ac8
authored
Dec 16, 2024
by
Grégoire Locqueville
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added back functions used in the tests
parent
c9abf005
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
Types.hs
src/Gargantext/API/Ngrams/Types.hs
+7
-0
weeder.toml
weeder.toml
+2
-0
No files found.
src/Gargantext/API/Ngrams/Types.hs
View file @
52110ac8
...
@@ -195,6 +195,10 @@ mkNgramsElement :: NgramsTerm
...
@@ -195,6 +195,10 @@ mkNgramsElement :: NgramsTerm
mkNgramsElement
ngrams
list'
rp
children
=
mkNgramsElement
ngrams
list'
rp
children
=
NgramsElement
ngrams
(
size
(
unNgramsTerm
ngrams
))
list'
mempty
(
_rp_root
<$>
rp
)
(
_rp_parent
<$>
rp
)
children
NgramsElement
ngrams
(
size
(
unNgramsTerm
ngrams
))
list'
mempty
(
_rp_root
<$>
rp
)
(
_rp_parent
<$>
rp
)
children
newNgramsElement
::
Maybe
ListType
->
NgramsTerm
->
NgramsElement
newNgramsElement
mayList
ngrams
=
mkNgramsElement
ngrams
(
fromMaybe
MapTerm
mayList
)
Nothing
mempty
instance
ToSchema
NgramsElement
where
instance
ToSchema
NgramsElement
where
declareNamedSchema
=
genericDeclareNamedSchema
(
unPrefixSwagger
"_ne_"
)
declareNamedSchema
=
genericDeclareNamedSchema
(
unPrefixSwagger
"_ne_"
)
...
@@ -463,6 +467,9 @@ newtype NgramsTablePatch = NgramsTablePatch (PatchMap NgramsTerm NgramsPatch)
...
@@ -463,6 +467,9 @@ newtype NgramsTablePatch = NgramsTablePatch (PatchMap NgramsTerm NgramsPatch)
deriving
stock
(
Eq
,
Show
,
Generic
)
deriving
stock
(
Eq
,
Show
,
Generic
)
deriving
newtype
(
ToJSON
,
FromJSON
,
Semigroup
,
Monoid
,
Validity
,
Transformable
)
deriving
newtype
(
ToJSON
,
FromJSON
,
Semigroup
,
Monoid
,
Validity
,
Transformable
)
mkNgramsTablePatch
::
Map
NgramsTerm
NgramsPatch
->
NgramsTablePatch
mkNgramsTablePatch
=
NgramsTablePatch
.
PM
.
fromMap
instance
FromField
NgramsTablePatch
instance
FromField
NgramsTablePatch
where
where
fromField
=
fromJSONField
fromField
=
fromJSONField
...
...
weeder.toml
View file @
52110ac8
...
@@ -27,6 +27,8 @@ roots = [ '^Main\.main$'
...
@@ -27,6 +27,8 @@ roots = [ '^Main\.main$'
# Used by the tests
# Used by the tests
# TODO this should probably moved to the tests?
# TODO this should probably moved to the tests?
,
'^Gargantext\.API\.Ngrams\.Types\.mkNgramsTablePatch$'
,
'^Gargantext\.API\.Ngrams\.Types\.newNgramsElement$'
,
'^Gargantext\.Core\.Text\.Corpus\.API\.Pubmed\.convertQuery$'
,
'^Gargantext\.Core\.Text\.Corpus\.API\.Pubmed\.convertQuery$'
,
'^Gargantext\.Core\.Text\.Corpus\.API\.Pubmed\.getESearch$'
,
'^Gargantext\.Core\.Text\.Corpus\.API\.Pubmed\.getESearch$'
...
...
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