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
3a8af37d
Commit
3a8af37d
authored
Sep 01, 2022
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] prepareText
parent
58ad4a3e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
Prepare.hs
src/Gargantext/Core/Text/Prepare.hs
+9
-9
No files found.
src/Gargantext/Core/Text/Prepare.hs
View file @
3a8af37d
...
...
@@ -17,7 +17,7 @@ that could be the incarnation of the mythic Gargantua.
{-# LANGUAGE OverloadedStrings #-}
module
Gargantext.Core.Text.
Clean
module
Gargantext.Core.Text.
Prepare
where
import
Data.Text
(
Text
)
...
...
@@ -40,19 +40,19 @@ prepareText p txt = groupText p
---------------------------------------------------------------------
groupText
::
Paragraph
->
[
Text
]
->
[
Text
]
groupText
(
Uniform
g
s
)
=
groupUniform
g
s
groupText
(
Uniform
blockSize
)
=
groupUniform
blockSize
groupText
AuthorLike
=
groupLines
---------------------------------------------------------------------
data
Paragraph
=
Uniform
Grain
Step
|
AuthorLike
data
Paragraph
=
Uniform
Grain
|
AuthorLike
-- Uniform does not preserve the paragraphs of the author but length of paragraphs is uniform
-- Author Like preserve the paragraphs of the Author but length of paragraphs is not uniform
-- Grain: number of Sentences by block of Text
-- Step : overlap of sentence between connex block of Text
groupUniform
::
Grain
->
Step
->
[
Text
]
->
[
Text
]
groupUniform
g
s
ts
=
map
(
Text
.
intercalate
" "
)
$
chunkAlong
g
s
groupUniform
::
Grain
->
[
Text
]
->
[
Text
]
groupUniform
g
ts
=
map
(
Text
.
intercalate
" "
)
$
chunkAlong
g
g
$
sentences
$
Text
.
concat
ts
...
...
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