Commit 52110ac8 authored by Grégoire Locqueville's avatar Grégoire Locqueville

Added back functions used in the tests

parent c9abf005
......@@ -195,6 +195,10 @@ mkNgramsElement :: NgramsTerm
mkNgramsElement ngrams list' 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
declareNamedSchema = genericDeclareNamedSchema (unPrefixSwagger "_ne_")
......@@ -463,6 +467,9 @@ newtype NgramsTablePatch = NgramsTablePatch (PatchMap NgramsTerm NgramsPatch)
deriving stock (Eq, Show, Generic)
deriving newtype (ToJSON, FromJSON, Semigroup, Monoid, Validity, Transformable)
mkNgramsTablePatch :: Map NgramsTerm NgramsPatch -> NgramsTablePatch
mkNgramsTablePatch = NgramsTablePatch . PM.fromMap
instance FromField NgramsTablePatch
where
fromField = fromJSONField
......
......@@ -27,6 +27,8 @@ roots = [ '^Main\.main$'
# Used by 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\.getESearch$'
......
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