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
199
Issues
199
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
a6bf275a
Unverified
Commit
a6bf275a
authored
Mar 21, 2019
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small refactoring to have less hard-coded Lang
parent
45cddcc1
Pipeline
#296
canceled with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
Flow.hs
src/Gargantext/Database/Flow.hs
+4
-4
Terms.hs
src/Gargantext/Text/Terms.hs
+7
-1
No files found.
src/Gargantext/Database/Flow.hs
View file @
a6bf275a
...
@@ -104,16 +104,16 @@ flowCorpus :: (FlowCmdM env ServantErr m, ToHyperdataDocument a)
...
@@ -104,16 +104,16 @@ flowCorpus :: (FlowCmdM env ServantErr m, ToHyperdataDocument a)
=>
Username
->
CorpusName
->
TermType
Lang
->
[[
a
]]
->
m
CorpusId
=>
Username
->
CorpusName
->
TermType
Lang
->
[[
a
]]
->
m
CorpusId
flowCorpus
u
cn
la
docs
=
do
flowCorpus
u
cn
la
docs
=
do
ids
<-
mapM
((
insertMasterDocs
la
)
.
(
map
toHyperdataDocument
))
docs
ids
<-
mapM
((
insertMasterDocs
la
)
.
(
map
toHyperdataDocument
))
docs
flowCorpusUser
FR
u
cn
(
concat
ids
)
flowCorpusUser
(
la
^.
tt_lang
)
u
cn
(
concat
ids
)
-- TODO query with complex query
-- TODO query with complex query
flowCorpusSearchInDatabase
::
FlowCmdM
env
ServantErr
m
flowCorpusSearchInDatabase
::
FlowCmdM
env
ServantErr
m
=>
Username
->
Text
->
m
CorpusId
=>
Username
->
Text
->
Lang
->
m
CorpusId
flowCorpusSearchInDatabase
u
q
=
do
flowCorpusSearchInDatabase
u
la
q
=
do
(
_masterUserId
,
_masterRootId
,
cId
)
<-
getOrMkRootWithCorpus
userMaster
""
(
_masterUserId
,
_masterRootId
,
cId
)
<-
getOrMkRootWithCorpus
userMaster
""
ids
<-
map
fst
<$>
searchInDatabase
cId
(
stemIt
q
)
ids
<-
map
fst
<$>
searchInDatabase
cId
(
stemIt
q
)
flowCorpusUser
FR
u
q
ids
flowCorpusUser
la
u
q
ids
flowCorpusUser
::
FlowCmdM
env
ServantErr
m
flowCorpusUser
::
FlowCmdM
env
ServantErr
m
...
...
src/Gargantext/Text/Terms.hs
View file @
a6bf275a
...
@@ -29,10 +29,12 @@ compute graph
...
@@ -29,10 +29,12 @@ compute graph
-}
-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
module
Gargantext.Text.Terms
module
Gargantext.Text.Terms
where
where
import
Control.Lens
import
Data.Text
(
Text
)
import
Data.Text
(
Text
)
import
Data.Traversable
import
Data.Traversable
...
@@ -43,8 +45,12 @@ import Gargantext.Text.Terms.Multi (multiterms)
...
@@ -43,8 +45,12 @@ import Gargantext.Text.Terms.Multi (multiterms)
import
Gargantext.Text.Terms.Mono
(
monoTerms
)
import
Gargantext.Text.Terms.Mono
(
monoTerms
)
data
TermType
lang
=
Mono
lang
|
Multi
lang
|
MonoMulti
lang
data
TermType
lang
=
Mono
{
_tt_lang
::
lang
}
|
Multi
{
_tt_lang
::
lang
}
|
MonoMulti
{
_tt_lang
::
lang
}
makeLenses
''
T
ermType
--group :: [Text] -> [Text]
--group :: [Text] -> [Text]
--group = undefined
--group = undefined
...
...
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