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
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
Christian Merten
haskell-gargantext
Commits
4dc5f9e2
Commit
4dc5f9e2
authored
Apr 01, 2022
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[john-snow-nlp] some tests for get pos/lemma
parent
3590f89f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
4 deletions
+20
-4
List.hs
src/Gargantext/API/Ngrams/List.hs
+1
-1
WithList.hs
src/Gargantext/Core/Text/Terms/WithList.hs
+1
-3
JohnSnowNLP.hs
src/Gargantext/Utils/JohnSnowNLP.hs
+18
-0
No files found.
src/Gargantext/API/Ngrams/List.hs
View file @
4dc5f9e2
...
...
@@ -172,7 +172,7 @@ reIndexWith cId lId nt lts = do
,
doc
^.
context_hyperdata
.
hd_abstract
]
)
(
List
.
cycle
[
Map
.
fromList
$
[(
nt
,
Map
.
singleton
(
doc
^.
context_id
)
1
)]])
(
List
.
cycle
[
Map
.
fromList
$
[(
nt
,
Map
.
singleton
(
doc
^.
context_id
)
1
)]])
)
docs
-- printDebug "ngramsByDoc" ngramsByDoc
...
...
src/Gargantext/Core/Text/Terms/WithList.hs
View file @
4dc5f9e2
...
...
@@ -38,9 +38,7 @@ type Patterns = [Pattern]
replaceTerms
::
Patterns
->
[
Text
]
->
[[
Text
]]
replaceTerms
pats
terms
=
go
0
where
terms_len
=
length
terms
go
ix
|
ix
>=
terms_len
=
[]
go
ix
|
ix
>=
(
length
terms
)
=
[]
|
otherwise
=
case
IntMap
.
lookup
ix
m
of
Nothing
->
go
(
ix
+
1
)
...
...
src/Gargantext/Utils/JohnSnowNLP.hs
View file @
4dc5f9e2
...
...
@@ -179,6 +179,24 @@ waitForJsTask jsTask = wait' 0
_
<-
threadDelay
$
1000000
*
1
wait'
$
counter
+
1
getPosTag
::
Lang
->
Text
->
IO
JSAsyncTaskResponse
getPosTag
l
t
=
do
jsPosTask
<-
jsRequest
t
(
JSPOS
l
)
-- wait for both tasks
jsPos
<-
waitForJsTask
jsPosTask
pure
jsPos
getLems
::
Lang
->
Text
->
IO
JSAsyncTaskResponse
getLems
l
t
=
do
jsLemma
<-
jsRequest
t
(
JSLemma
l
)
-- wait for both tasks
jsLemma
<-
waitForJsTask
jsLemma
pure
jsLemma
getPosTagAndLems
::
Lang
->
Text
->
IO
PosSentences
getPosTagAndLems
l
t
=
do
jsPosTask
<-
jsRequest
t
(
JSPOS
l
)
...
...
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