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
777cf4cc
Commit
777cf4cc
authored
Jan 20, 2021
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] clean groups + handling duplicates (TODO inside)
parent
e55c6044
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
5 deletions
+9
-5
schema.sql
devops/postgres/schema.sql
+1
-1
Types.hs
src/Gargantext/API/Ngrams/Types.hs
+1
-0
WithStem.hs
src/Gargantext/Core/Text/List/Group/WithStem.hs
+4
-2
NgramsPostag.hs
src/Gargantext/Database/Query/Table/NgramsPostag.hs
+3
-2
No files found.
devops/postgres/schema.sql
View file @
777cf4cc
src/Gargantext/API/Ngrams/Types.hs
View file @
777cf4cc
...
@@ -127,6 +127,7 @@ instance (ToJSONKey a, ToSchema a) => ToSchema (MSet a) where
...
@@ -127,6 +127,7 @@ instance (ToJSONKey a, ToSchema a) => ToSchema (MSet a) where
newtype
NgramsTerm
=
NgramsTerm
{
unNgramsTerm
::
Text
}
newtype
NgramsTerm
=
NgramsTerm
{
unNgramsTerm
::
Text
}
deriving
(
Ord
,
Eq
,
Show
,
Generic
,
ToJSONKey
,
ToJSON
,
FromJSON
,
Semigroup
,
Arbitrary
,
Serialise
,
ToSchema
,
Hashable
)
deriving
(
Ord
,
Eq
,
Show
,
Generic
,
ToJSONKey
,
ToJSON
,
FromJSON
,
Semigroup
,
Arbitrary
,
Serialise
,
ToSchema
,
Hashable
)
instance
IsHashable
NgramsTerm
where
instance
IsHashable
NgramsTerm
where
hash
(
NgramsTerm
t
)
=
hash
t
hash
(
NgramsTerm
t
)
=
hash
t
...
...
src/Gargantext/Core/Text/List/Group/WithStem.hs
View file @
777cf4cc
...
@@ -88,8 +88,10 @@ groupWith (GroupParams l _m _n _) t =
...
@@ -88,8 +88,10 @@ groupWith (GroupParams l _m _n _) t =
-- | This lemmatization group done with CoreNLP algo (or others)
-- | This lemmatization group done with CoreNLP algo (or others)
groupWith
(
GroupWithPosTag
_
_
m
)
t
=
groupWith
(
GroupWithPosTag
_
_
m
)
t
=
case
HashMap
.
lookup
(
unNgramsTerm
t
)
m
of
case
HashMap
.
lookup
(
unNgramsTerm
t
)
m
of
Nothing
->
t
Nothing
->
clean
t
Just
t'
->
NgramsTerm
t'
Just
t'
->
clean
$
NgramsTerm
t'
where
clean
(
NgramsTerm
t
)
=
NgramsTerm
$
Text
.
replace
"-"
" "
t
--------------------------------------------------------------------
--------------------------------------------------------------------
stemPatches
::
GroupParams
stemPatches
::
GroupParams
...
...
src/Gargantext/Database/Query/Table/NgramsPostag.hs
View file @
777cf4cc
...
@@ -144,7 +144,8 @@ queryInsertNgramsPostag = [sql|
...
@@ -144,7 +144,8 @@ queryInsertNgramsPostag = [sql|
-- ORDER BY s DESC
-- ORDER BY s DESC
-- LIMIT 1
-- LIMIT 1
ON CONFLICT (lang_id,algo_id,postag,ngrams_id,lemm_id)
ON CONFLICT (lang_id,algo_id,postag,ngrams_id,lemm_id)
DO UPDATE SET score = ngrams_postag.score + 1
DO NOTHING -- acceptable for now since we are using NP mainly
-- DO UPDATE SET score = ngrams_postag.score + 1
)
)
SELECT terms,id FROM ins_form_ret
SELECT terms,id FROM ins_form_ret
...
...
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