Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
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
Przemyslaw Kaminski
haskell-gargantext
Commits
d8fb64ce
Unverified
Commit
d8fb64ce
authored
Mar 01, 2019
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NGRAMS-REPO]: filters tweaks and fixes
parent
a5013d31
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
Ngrams.hs
src/Gargantext/API/Ngrams.hs
+8
-3
No files found.
src/Gargantext/API/Ngrams.hs
View file @
d8fb64ce
...
@@ -47,7 +47,7 @@ import Data.Monoid
...
@@ -47,7 +47,7 @@ import Data.Monoid
--import Data.Semigroup
--import Data.Semigroup
import
Data.Set
(
Set
)
import
Data.Set
(
Set
)
-- import qualified Data.List as List
-- import qualified Data.List as List
-- import Data.Maybe (catMaybes
)
import
Data.Maybe
(
isNothing
)
-- import Data.Tuple.Extra (first)
-- import Data.Tuple.Extra (first)
import
qualified
Data.Map.Strict
as
Map
import
qualified
Data.Map.Strict
as
Map
import
Data.Map.Strict
(
Map
)
import
Data.Map.Strict
(
Map
)
...
@@ -847,7 +847,12 @@ getTableNgrams _cId maybeTabType listIds mlimit moffset
...
@@ -847,7 +847,12 @@ getTableNgrams _cId maybeTabType listIds mlimit moffset
minSize
=
maybe
(
const
True
)
(
<=
)
mminSize
minSize
=
maybe
(
const
True
)
(
<=
)
mminSize
maxSize
=
maybe
(
const
True
)
(
>=
)
mmaxSize
maxSize
=
maybe
(
const
True
)
(
>=
)
mmaxSize
searchQuery
=
maybe
(
const
True
)
isInfixOf
msearchQuery
searchQuery
=
maybe
(
const
True
)
isInfixOf
msearchQuery
selected
n
=
minSize
s
-- TODO
-- * non root selected ngrams should be replaced by their root
-- + what to do with duplicates
-- + which order
selected
n
=
isNothing
(
n
^.
ne_parent
)
&&
minSize
s
&&
maxSize
s
&&
maxSize
s
&&
searchQuery
(
n
^.
ne_ngrams
)
&&
searchQuery
(
n
^.
ne_ngrams
)
&&
listType
(
n
^.
ne_list
)
&&
listType
(
n
^.
ne_list
)
...
@@ -858,7 +863,7 @@ getTableNgrams _cId maybeTabType listIds mlimit moffset
...
@@ -858,7 +863,7 @@ getTableNgrams _cId maybeTabType listIds mlimit moffset
-- trace (show lists) $
-- trace (show lists) $
getListNgrams
(
{-lists <>-}
listIds
)
ngramsType
getListNgrams
(
{-lists <>-}
listIds
)
ngramsType
&
mapped
.
v_data
.
_NgramsTable
&
mapped
.
v_data
.
_NgramsTable
%~
(
filter
selected
.
take
limit_
.
drop
offset_
)
%~
(
take
limit_
.
drop
offset_
.
filter
selected
)
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