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
148
Issues
148
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
a52e3832
Commit
a52e3832
authored
Apr 15, 2019
by
Quentin Lobbé
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-phylo' of
https://gitlab.iscpif.fr/gargantext/haskell-gargantext
into dev-phylo
parents
d341c4b2
3f46358d
Pipeline
#351
canceled with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
1 deletion
+34
-1
package.yaml
package.yaml
+24
-0
WithList.hs
src/Gargantext/Text/Terms/WithList.hs
+10
-1
No files found.
package.yaml
View file @
a52e3832
...
...
@@ -241,6 +241,30 @@ executables:
-
unordered-containers
-
full-text-search
gargantext-phylo
:
main
:
Main.hs
source-dirs
:
bin/gargantext-phylo
ghc-options
:
-
-threaded
-
-rtsopts
-
-with-rtsopts=-N
-
-O2
-
-Wmissing-signatures
dependencies
:
-
aeson
-
async
-
base
-
bytestring
-
containers
-
gargantext
-
vector
-
parallel
-
cassava
-
ini
-
optparse-generic
-
split
-
unordered-containers
gargantext-import
:
main
:
Main.hs
source-dirs
:
bin/gargantext-import
...
...
src/Gargantext/Text/Terms/WithList.hs
View file @
a52e3832
...
...
@@ -18,7 +18,7 @@ commentary with @some markup@.
module
Gargantext.Text.Terms.WithList
where
import
qualified
Data.Algorithms.KMP
as
KMP
import
Data.Text
(
Text
)
import
Data.Text
(
Text
,
concat
)
import
qualified
Data.IntMap.Strict
as
IntMap
import
Gargantext.Text.Context
...
...
@@ -75,3 +75,12 @@ buildPatterns = sortWith (Down . _pat_length) . concatMap buildPattern
extractTermsWithList
::
Patterns
->
Text
->
Corpus
[
Text
]
extractTermsWithList
pats
=
map
(
replaceTerms
pats
)
.
monoTextsBySentence
-- | Extract terms
-- >>> let termList = [(["chat blanc"], [["chat","blanc"]])] :: TermList
-- extractTermsWithList' (buildPatterns termList) "Le chat blanc"["chat blanc"]
-- ["chat blanc"]
extractTermsWithList'
::
Patterns
->
Text
->
[
Text
]
extractTermsWithList'
pats
=
map
(
concat
.
map
concat
.
replaceTerms
pats
)
.
monoTextsBySentence
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