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
13aed284
Commit
13aed284
authored
Apr 15, 2019
by
Alexandre Delanoë
Committed by
Quentin Lobbé
May 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BIN/PHYLO] first draft, needs phylo connection.
parent
985b9c83
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
package.yaml
package.yaml
+23
-0
WithList.hs
src/Gargantext/Text/Terms/WithList.hs
+10
-1
No files found.
package.yaml
View file @
13aed284
...
...
@@ -241,6 +241,29 @@ 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
-
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 @
13aed284
...
...
@@ -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
,
unpack
)
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