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
145
Issues
145
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
7c083bed
Commit
7c083bed
authored
Oct 25, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FLOW][DB][NGRAMS] grouping function and insertion design (for meeting).
parent
b6abd151
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
12 deletions
+20
-12
Flow.hs
src/Gargantext/Database/Flow.hs
+14
-10
NodeNgramNgram.hs
src/Gargantext/Database/NodeNgramNgram.hs
+6
-2
No files found.
src/Gargantext/Database/Flow.hs
View file @
7c083bed
...
@@ -108,9 +108,11 @@ toInserted :: [ReturnId] -> Map HashId ReturnId
...
@@ -108,9 +108,11 @@ toInserted :: [ReturnId] -> Map HashId ReturnId
toInserted
rs
=
DM
.
fromList
$
map
(
\
r
->
(
reUniqId
r
,
r
)
)
toInserted
rs
=
DM
.
fromList
$
map
(
\
r
->
(
reUniqId
r
,
r
)
)
$
filter
(
\
r
->
reInserted
r
==
True
)
rs
$
filter
(
\
r
->
reInserted
r
==
True
)
rs
data
DocumentWithId
=
DocumentWithId
{
documentId
::
NodeId
data
DocumentWithId
=
,
documentData
::
HyperdataDocument
DocumentWithId
}
{
documentId
::
NodeId
,
documentData
::
HyperdataDocument
}
mergeData
::
Map
HashId
ReturnId
->
Map
HashId
HyperdataDocument
->
[
DocumentWithId
]
mergeData
::
Map
HashId
ReturnId
->
Map
HashId
HyperdataDocument
->
[
DocumentWithId
]
...
@@ -118,10 +120,11 @@ mergeData rs hs = map (\(hash,r) -> DocumentWithId (reId r) (lookup' hash hs)) $
...
@@ -118,10 +120,11 @@ mergeData rs hs = map (\(hash,r) -> DocumentWithId (reId r) (lookup' hash hs)) $
where
where
lookup'
h
xs
=
maybe
(
panic
$
"Error with "
<>
h
)
identity
(
DM
.
lookup
h
xs
)
lookup'
h
xs
=
maybe
(
panic
$
"Error with "
<>
h
)
identity
(
DM
.
lookup
h
xs
)
data
DocumentIdWithNgrams
=
DocumentIdWithNgrams
{
documentWithId
::
DocumentWithId
data
DocumentIdWithNgrams
=
,
document_ngrams
::
Map
(
NgramsT
Ngrams
)
Int
DocumentIdWithNgrams
}
{
documentWithId
::
DocumentWithId
,
document_ngrams
::
Map
(
NgramsT
Ngrams
)
Int
}
documentIdWithNgrams
::
(
HyperdataDocument
->
Map
(
NgramsT
Ngrams
)
Int
)
documentIdWithNgrams
::
(
HyperdataDocument
->
Map
(
NgramsT
Ngrams
)
Int
)
->
[
DocumentWithId
]
->
[
DocumentIdWithNgrams
]
->
[
DocumentWithId
]
->
[
DocumentIdWithNgrams
]
...
@@ -149,19 +152,20 @@ insertToNodeNgrams m = insertNodeNgrams $ [ NodeNgram Nothing nId ((_ngramsId
...
@@ -149,19 +152,20 @@ insertToNodeNgrams m = insertNodeNgrams $ [ NodeNgram Nothing nId ((_ngramsId
,
(
nId
,
n
)
<-
DM
.
toList
nId2int
,
(
nId
,
n
)
<-
DM
.
toList
nId2int
]
]
------------------------------------------------------------------------
groupNgramsBy
::
fun
listFlow
::
UserId
->
CorpusId
->
Map
(
NgramsT
NgramsIndexed
)
(
Map
NodeId
Int
)
->
Cmd
[
ListId
]
listFlow
::
UserId
->
CorpusId
->
Map
(
NgramsT
NgramsIndexed
)
(
Map
NodeId
Int
)
->
Cmd
[
ListId
]
listFlow
uId
cId
ng
=
do
listFlow
uId
cId
ng
=
do
lId
<-
mkList
cId
uId
lId
<-
mkList
cId
uId
-- groupNgramsBy fun
-- insertGroups = NodeNgramsNgrams
-- insertGroups = NodeNgramsNgrams
pure
lId
-- compute Candidate / Map
-- compute Candidate / Map
-- ALTER TABLE nodes_nodes_ngrams ADD COLUMN typelist int;
-- ALTER TABLE nodes_nodes_ngrams ADD COLUMN typelist int;
-- insertLists = NodeNodeNgram
-- insertLists = NodeNodeNgram
pure
lId
...
...
src/Gargantext/Database/NodeNgramNgram.hs
View file @
7c083bed
...
@@ -7,8 +7,12 @@ Maintainer : team@gargantext.org
...
@@ -7,8 +7,12 @@ Maintainer : team@gargantext.org
Stability : experimental
Stability : experimental
Portability : POSIX
Portability : POSIX
Here is a longer description of this module, containing some
NodeNgramNgram table is used to group Ngrams
commentary with @some markup@.
Next Step:
- group with: https://en.wikipedia.org/wiki/Nested_set_model
-}
-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
...
...
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