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
160
Issues
160
List
Board
Labels
Milestones
Merge Requests
14
Merge Requests
14
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
893b4cf8
Commit
893b4cf8
authored
Oct 21, 2024
by
Yoelis Acourt
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(ngrams): occurences counting with quotes
parent
163304df
Pipeline
#6864
failed with stages
in 48 minutes and 39 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
2 deletions
+27
-2
gargantext.cabal
gargantext.cabal
+2
-1
Mono.hs
src/Gargantext/Core/Text/Terms/Mono.hs
+1
-1
Occurrences.hs
test/Test/Ngrams/Lang/Occurrences.hs
+21
-0
Main.hs
test/drivers/tasty/Main.hs
+3
-0
No files found.
gargantext.cabal
View file @
893b4cf8
...
...
@@ -836,7 +836,8 @@ test-suite garg-test-tasty
Test.Server.ReverseProxy
Test.Types
Test.Utils
Test.Utils.Crypto
Test.Utils.Crypto
Test.Ngrams.Lang.Occurrences
Test.Utils.Jobs
hs-source-dirs:
test bin/gargantext-cli
...
...
src/Gargantext/Core/Text/Terms/Mono.hs
View file @
893b4cf8
...
...
@@ -33,7 +33,7 @@ words = monoTexts
-- | Sentence split separators
isSep
::
Char
->
Bool
isSep
=
(`
elem
`
(
",.:;?!(){}[]
\"\'
"
::
String
))
isSep
=
(`
elem
`
(
",.:;?!(){}[]"
::
String
))
monoTerms
::
Lang
->
Text
->
[
TermsWithCount
]
monoTerms
l
txt
=
map
(
\
t
->
(
monoText2term
l
t
,
1
))
$
monoTexts
txt
...
...
test/Test/Ngrams/Lang/Occurrences.hs
View file @
893b4cf8
...
...
@@ -14,7 +14,28 @@ commentary with @some markup@.
{-# LANGUAGE ScopedTypeVariables #-}
module
Test.Ngrams.Lang.Occurrences
where
import
Test.Hspec
import
Data.Either
import
Gargantext.Core.Text.Terms.WithList
import
Gargantext.Core
(
Lang
(
ZH
,
EN
))
import
Gargantext.Prelude
test
::
Spec
test
=
do
describe
"terms in text counting"
$
do
it
"words with quotes should match"
$
do
let
ngrams
=
[
"j'aime"
]
let
doc
=
"j'aime"
let
output
=
[]
termsInText
EN
(
buildPatternsWith
EN
ngrams
)
doc
`
shouldBe
`
[(
"j'aime"
,
1
)]
-- it "words with quotes should match and be case sentive" $ do
-- let ngrams = ["j'aIme"]
-- let doc = "j'aime"
-- let output = []
-- termsInText EN (buildPatternsWith EN ngrams) doc `shouldNotBe` [("j'aime", 1)]
{-
import Test.Hspec
...
...
test/drivers/tasty/Main.hs
View file @
893b4cf8
...
...
@@ -27,6 +27,7 @@ import qualified Test.Utils.Crypto as Crypto
import
qualified
Test.Utils.Jobs
as
Jobs
import
qualified
Test.Core.Similarity
as
Similarity
import
qualified
Test.Core.AsyncUpdates
as
AsyncUpdates
import
qualified
Test.Ngrams.Lang.Occurrences
as
Occurrences
import
Test.Tasty
import
Test.Tasty.Hspec
...
...
@@ -41,6 +42,7 @@ main = do
jobsSpec
<-
testSpec
"Jobs"
Jobs
.
test
similaritySpec
<-
testSpec
"Similarity"
Similarity
.
test
asyncUpdatesSpec
<-
testSpec
"AsyncUpdates"
AsyncUpdates
.
test
occurrencesSepc
<-
testSpec
"AsyncUpdates"
Occurrences
.
test
defaultMain
$
testGroup
"Gargantext"
[
utilSpec
...
...
@@ -49,6 +51,7 @@ main = do
,
cryptoSpec
,
nlpSpec
,
jobsSpec
,
occurrencesSepc
,
NgramsQuery
.
tests
,
CorpusQuery
.
tests
,
TSVParser
.
tests
...
...
Przemyslaw Kaminski
@cgenie
mentioned in commit
83c8708f
·
Nov 07, 2024
mentioned in commit
83c8708f
mentioned in commit 83c8708f08e563243a0ff361e51a46c7d7822bb7
Toggle commit list
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