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
153
Issues
153
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
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
e49efe51
Commit
e49efe51
authored
Apr 26, 2023
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Data.List qualified import
parent
ea0fe616
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
20 deletions
+18
-20
En.hs
src/Gargantext/Core/Text/Terms/Mono/Stem/En.hs
+13
-14
FGL.hs
src/Gargantext/Core/Viz/Graph/FGL.hs
+1
-1
Queue.hs
src/Gargantext/Utils/Jobs/Queue.hs
+2
-3
State.hs
src/Gargantext/Utils/Jobs/State.hs
+2
-2
No files found.
src/Gargantext/Core/Text/Terms/Mono/Stem/En.hs
View file @
e49efe51
...
...
@@ -21,12 +21,11 @@ module Gargantext.Core.Text.Terms.Mono.Stem.En (stemIt)
import
Control.Monad
import
Data.Either
import
Data.List
((
!!
))
import
Data.Maybe
import
Data.Text
(
Text
(),
pack
,
unpack
)
import
Data.List
hiding
(
map
,
head
)
import
Gargantext.Prelude
import
qualified
Data.List
as
List
hiding
(
map
,
head
)
vowels
::
[
Char
]
vowels
=
[
'a'
,
'e'
,
'i'
,
'o'
,
'u'
]
...
...
@@ -50,16 +49,16 @@ containsVowel = byIndex (any . isVowel)
-- | /!\ unsafe fromJust
measure
::
[
Char
]
->
Int
measure
=
length
.
filter
not
.
init
.
(
True
:
)
measure
=
length
.
filter
not
.
List
.
init
.
(
True
:
)
.
map
fromJust
.
map
head
.
group
.
byIndex
(
map
.
isConsonant
)
.
List
.
group
.
byIndex
(
map
.
isConsonant
)
endsWithDouble
::
[
Char
]
->
Bool
endsWithDouble
=
startsWithDouble
.
reverse
where
startsWithDouble
l
=
case
l
of
(
x
:
y
:
_
)
->
x
==
y
&&
x
`
notElem
`
vowels
(
x
:
y
:
_
)
->
x
==
y
&&
x
`
List
.
notElem
`
vowels
_
->
False
cvc
::
[
Char
]
->
Bool
...
...
@@ -67,18 +66,18 @@ cvc word | length word < 3 = False
|
otherwise
=
isConsonant
word
lastIndex
&&
isVowel
word
(
lastIndex
-
1
)
&&
isConsonant
word
(
lastIndex
-
2
)
&&
last
word
`
notElem
`
[
'w'
,
'x'
,
'y'
]
List
.
last
word
`
List
.
notElem
`
[
'w'
,
'x'
,
'y'
]
where
lastIndex
=
length
word
-
1
statefulReplace
::
Eq
a
=>
([
a
]
->
Bool
)
->
[
a
]
->
[
a
]
->
[
a
]
->
Maybe
(
Data
.
Either
.
Either
[
a
]
[
a
])
statefulReplace
predicate
str
end
replacement
|
end
`
isSuffixOf
`
str
=
Just
replaced
|
end
`
List
.
isSuffixOf
`
str
=
Just
replaced
|
otherwise
=
Nothing
where
part
=
take
(
length
str
-
length
end
)
str
replaced
|
predicate
part
=
Right
(
part
++
replacement
)
replaced
|
predicate
part
=
Right
(
part
<>
replacement
)
|
otherwise
=
Left
str
replaceEnd
::
Eq
a
=>
([
a
]
->
Bool
)
->
[
a
]
->
[
a
]
->
[
a
]
->
Maybe
[
a
]
...
...
@@ -113,12 +112,12 @@ beforeStep1b word = fromMaybe (Left word) result
afterStep1b
::
[
Char
]
->
[
Char
]
afterStep1b
word
=
fromMaybe
word
result
where
double
=
endsWithDouble
word
&&
not
(
any
((`
isSuffixOf
`
word
)
.
return
)
[
'l'
,
's'
,
'z'
])
double
=
endsWithDouble
word
&&
not
(
any
((`
List
.
isSuffixOf
`
word
)
.
return
)
[
'l'
,
's'
,
'z'
])
mEq1AndCvc
=
measure
word
==
1
&&
cvc
word
iif
cond
val
=
if
cond
then
Just
val
else
Nothing
result
=
findStem
(
const
True
)
word
[(
"at"
,
"ate"
),
(
"bl"
,
"ble"
),
(
"iz"
,
"ize"
)]
`
mplus
`
iif
double
(
init
word
)
`
mplus
`
iif
mEq1AndCvc
(
word
++
"e"
)
`
mplus
`
iif
double
(
List
.
init
word
)
`
mplus
`
iif
mEq1AndCvc
(
word
<>
"e"
)
step1b
::
[
Char
]
->
[
Char
]
step1b
=
either
identity
afterStep1b
.
beforeStep1b
...
...
@@ -171,7 +170,7 @@ step3 word = fromMaybe word result
step4
::
[
Char
]
->
[
Char
]
step4
word
=
fromMaybe
word
result
where
gt1andST
str
=
(
measureGT
1
)
str
&&
any
((`
isSuffixOf
`
str
)
.
return
)
[
's'
,
't'
]
gt1andST
str
=
(
measureGT
1
)
str
&&
any
((`
List
.
isSuffixOf
`
str
)
.
return
)
[
's'
,
't'
]
findGT1
=
findStem
(
measureGT
1
)
word
.
map
(
flip
(,)
""
)
result
=
(
findGT1
[
"al"
,
"ance"
,
"ence"
,
"er"
,
"ic"
,
"able"
,
"ible"
,
"ant"
,
"ement"
,
"ment"
,
"ent"
])
`
mplus
`
(
findStem
gt1andST
word
[(
"ion"
,
""
)])
`
mplus
`
...
...
@@ -186,7 +185,7 @@ step5a word = fromMaybe word result
step5b
::
[
Char
]
->
[
Char
]
step5b
word
=
fromMaybe
word
result
where
cond
s
=
last
s
==
'l'
&&
measureGT
1
s
cond
s
=
List
.
last
s
==
'l'
&&
measureGT
1
s
result
=
replaceEnd
cond
word
"l"
""
step5
::
[
Char
]
->
[
Char
]
...
...
src/Gargantext/Core/Viz/Graph/FGL.hs
View file @
e49efe51
...
...
@@ -16,7 +16,7 @@ module Gargantext.Core.Viz.Graph.FGL where
import
Gargantext.Prelude
import
qualified
Data.Graph.Inductive
as
FGL
import
Data.List
as
List
import
qualified
Data.List
as
List
------------------------------------------------------------------
-- | Main Types
...
...
src/Gargantext/Utils/Jobs/Queue.hs
View file @
e49efe51
...
...
@@ -6,12 +6,11 @@ import Control.Concurrent.STM
import
Control.Exception
import
Control.Monad
import
Data.Function
import
Data.List
import
Data.Ord
import
Data.Maybe
import
Data.Ord
import
Prelude
import
System.IO
import
Data.List
import
qualified
Data.Map
as
Map
import
qualified
Data.Vector
as
Vector
...
...
src/Gargantext/Utils/Jobs/State.hs
View file @
e49efe51
...
...
@@ -7,7 +7,7 @@ import Gargantext.Utils.Jobs.Settings
import
Control.Concurrent.Async
import
Control.Concurrent.STM
import
Control.Monad
import
Data.
List
import
qualified
Data.List
as
List
import
Data.Map.Strict
(
Map
)
import
Data.Maybe
import
Data.Ord
...
...
@@ -67,7 +67,7 @@ newJobsState js prios = do
case
mje
of
Nothing
->
return
Nothing
Just
je
->
return
$
Just
(
jid
,
popjid
,
jRegistered
je
)
let
(
jid
,
popjid
,
_
)
=
minimumBy
(
comparing
_3
)
jinfos
let
(
jid
,
popjid
,
_
)
=
List
.
minimumBy
(
comparing
_3
)
jinfos
return
(
jid
,
popjid
)
_3
(
_
,
_
,
c
)
=
c
...
...
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