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
199
Issues
199
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
f940ca89
Commit
f940ca89
authored
Jun 12, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FACTO] toToken Forward/Backward.
parent
8b507245
Pipeline
#465
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
Eleve.hs
src/Gargantext/Text/Eleve.hs
+9
-6
No files found.
src/Gargantext/Text/Eleve.hs
View file @
f940ca89
...
@@ -359,11 +359,14 @@ mainEleve n input = map (map printToken) . split identity (t :: Trie Token Doubl
...
@@ -359,11 +359,14 @@ mainEleve n input = map (map printToken) . split identity (t :: Trie Token Doubl
chunkAlongEleve
::
Int
->
[
a
]
->
[[
a
]]
chunkAlongEleve
::
Int
->
[
a
]
->
[[
a
]]
chunkAlongEleve
n
xs
=
L
.
take
n
<$>
L
.
tails
xs
chunkAlongEleve
n
xs
=
L
.
take
n
<$>
L
.
tails
xs
toToken'
::
Int
->
[[
Text
]]
->
[[
Token
]]
data
Order
=
Backward
|
Forward
toToken'
n
input
=
L
.
concat
$
(
filter
(
/=
[
Terminal
Stop
])
.
chunkAlongEleve
(
n
+
2
))
<$>
toToken
<$>
input
toToken'
::
Order
->
Int
->
[[
Text
]]
->
[[
Token
]]
toToken'
o
n
input
=
L
.
concat
$
(
filter
(
/=
[
Terminal
Stop
])
.
chunkAlongEleve
(
n
+
2
)
.
(
order
o
)
)
<$>
toToken
<$>
input
where
order
Forward
=
identity
order
Backward
=
reverse
toTokenR'
::
Int
->
[[
Text
]]
->
[[
Token
]]
toTokenR'
n
input
=
L
.
concat
$
(
filter
(
/=
[
Terminal
Start
])
.
chunkAlongEleve
(
n
+
2
)
.
reverse
)
<$>
toToken
<$>
input
---------------------------------------------
---------------------------------------------
{-
{-
...
@@ -419,8 +422,8 @@ testEleve debug n output checks = do
...
@@ -419,8 +422,8 @@ testEleve debug n output checks = do
t
::
Tries
Token
Double
t
::
Tries
Token
Double
t
=
-- buildTrie (toToken' n input)
t
=
-- buildTrie (toToken' n input)
Tries
{
_fwd
=
buildTrie
(
toToken'
n
input
)
Tries
{
_fwd
=
buildTrie
(
toToken'
Forward
n
input
)
,
_bwd
=
buildTrie
(
toToken
R'
n
input
)
,
_bwd
=
buildTrie
(
toToken
'
Backward
n
input
)
}
}
evt
::
Tries
Token
(
I
Double
)
evt
::
Tries
Token
(
I
Double
)
...
...
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