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
Christian Merten
haskell-gargantext
Commits
6a45919d
Commit
6a45919d
authored
Mar 18, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FACTO|FLOW] HyperdataDocument.
parent
be59e592
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
Flow.hs
src/Gargantext/Database/Flow.hs
+10
-9
No files found.
src/Gargantext/Database/Flow.hs
View file @
6a45919d
...
...
@@ -76,13 +76,17 @@ type FlowCmdM env err m =
,
HasRepoVar
env
)
flowCorpus
::
FlowCmdM
env
ServantErr
m
=>
Username
->
CorpusName
->
TermType
Lang
->
FileFormat
->
FilePath
->
m
CorpusId
flowCorpus
u
cn
la
ff
fp
=
do
ids
<-
flowCorpusMaster
la
ff
fp
flowCorpus
u
cn
la
ff
fp
=
liftIO
(
parseDocs
ff
fp
)
>>=
\
docs
->
flowCorpus'
u
cn
la
docs
flowCorpus'
::
FlowCmdM
env
ServantErr
m
=>
Username
->
CorpusName
->
TermType
Lang
->
[
HyperdataDocument
]
->
m
CorpusId
flowCorpus'
u
cn
la
docs
=
do
ids
<-
flowCorpusMaster
la
docs
flowCorpusUser
u
cn
ids
-- TODO query with complex query
flowCorpusSearchInDatabase
::
FlowCmdM
env
ServantErr
m
=>
Username
->
Text
->
m
CorpusId
...
...
@@ -92,13 +96,10 @@ flowCorpusSearchInDatabase u q = do
flowCorpusUser
u
q
[
ids
]
flowCorpusMaster
::
FlowCmdM
env
ServantErr
m
=>
TermType
Lang
->
FileFormat
->
FilePath
->
m
[[
NodeId
]]
flowCorpusMaster
la
ff
fp
=
do
flowCorpusMaster
::
FlowCmdM
env
ServantErr
m
=>
TermType
Lang
->
[
HyperdataDocument
]
->
m
[[
NodeId
]]
flowCorpusMaster
la
hd
=
do
-- Master Flow
docs
<-
map
addUniqIdsDoc
<$>
liftIO
(
parseDocs
ff
fp
)
-- ChunkAlong needed for big corpora
-- TODO add LANG as parameter
let
docs
=
map
addUniqIdsDoc
hd
-- TODO uniformize language of corpus
ids
<-
mapM
(
insertMasterDocs
la
)
$
splitEvery
10000
docs
pure
ids
...
...
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