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
195
Issues
195
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
2ecc0288
Commit
2ecc0288
authored
Jul 18, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[COSMETICS]
parent
965531a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
6 deletions
+2
-6
Context.hs
src/Gargantext/Text/Context.hs
+1
-5
List.hs
src/Gargantext/Text/List.hs
+1
-1
No files found.
src/Gargantext/Text/Context.hs
View file @
2ecc0288
...
@@ -49,9 +49,6 @@ type Corpus a = [Sentence a] -- a list of sentences
...
@@ -49,9 +49,6 @@ type Corpus a = [Sentence a] -- a list of sentences
-- | Contexts definition to build/unbuild contexts.
-- | Contexts definition to build/unbuild contexts.
data
SplitContext
=
Chars
Int
|
Sentences
Int
|
Paragraphs
Int
data
SplitContext
=
Chars
Int
|
Sentences
Int
|
Paragraphs
Int
tag
::
Text
->
[
Tag
Text
]
tag
=
parseTags
-- | splitBy contexts of Chars or Sentences or Paragraphs
-- | splitBy contexts of Chars or Sentences or Paragraphs
-- To see some examples at a higher level (sentences and paragraph), see
-- To see some examples at a higher level (sentences and paragraph), see
-- 'Gargantext.Text.Examples.ex_terms'
-- 'Gargantext.Text.Examples.ex_terms'
...
@@ -67,10 +64,9 @@ tag = parseTags
...
@@ -67,10 +64,9 @@ tag = parseTags
splitBy
::
SplitContext
->
Text
->
[
Text
]
splitBy
::
SplitContext
->
Text
->
[
Text
]
splitBy
(
Chars
n
)
=
map
pack
.
chunkAlong
(
n
+
1
)
1
.
unpack
splitBy
(
Chars
n
)
=
map
pack
.
chunkAlong
(
n
+
1
)
1
.
unpack
splitBy
(
Sentences
n
)
=
map
unsentences
.
chunkAlong
(
n
+
1
)
1
.
sentences
splitBy
(
Sentences
n
)
=
map
unsentences
.
chunkAlong
(
n
+
1
)
1
.
sentences
splitBy
(
Paragraphs
_
)
=
map
unTag
.
filter
isTagText
.
tag
splitBy
(
Paragraphs
_
)
=
map
unTag
.
filter
isTagText
.
parseTags
where
where
unTag
::
IsString
p
=>
Tag
p
->
p
unTag
::
IsString
p
=>
Tag
p
->
p
unTag
(
TagText
x
)
=
x
unTag
(
TagText
x
)
=
x
unTag
_
=
""
unTag
_
=
""
src/Gargantext/Text/List.hs
View file @
2ecc0288
...
@@ -59,7 +59,7 @@ data StopSize = StopSize {unStopSize :: Int}
...
@@ -59,7 +59,7 @@ data StopSize = StopSize {unStopSize :: Int}
-- | TODO improve grouping functions of Authors, Sources, Institutes..
-- | TODO improve grouping functions of Authors, Sources, Institutes..
buildNgramsLists
::
Lang
->
Int
->
Int
->
StopSize
->
UserCorpusId
->
MasterCorpusId
buildNgramsLists
::
Lang
->
Int
->
Int
->
StopSize
->
UserCorpusId
->
MasterCorpusId
->
Cmd
err
(
Map
NgramsType
[
NgramsElement
])
->
Cmd
err
(
Map
NgramsType
[
NgramsElement
])
buildNgramsLists
l
n
m
s
uCid
mCid
=
do
buildNgramsLists
l
n
m
s
uCid
_
mCid
=
do
--ngTerms <- buildNgramsTermsList l n m s uCid mCid
--ngTerms <- buildNgramsTermsList l n m s uCid mCid
ngTerms
<-
buildNgramsTermsList'
uCid
(
ngramsGroup
l
n
m
)
(
isStopTerm
s
.
fst
)
500
50
ngTerms
<-
buildNgramsTermsList'
uCid
(
ngramsGroup
l
n
m
)
(
isStopTerm
s
.
fst
)
500
50
othersTerms
<-
mapM
(
buildNgramsOthersList
uCid
identity
)
[
Authors
,
Sources
,
Institutes
]
othersTerms
<-
mapM
(
buildNgramsOthersList
uCid
identity
)
[
Authors
,
Sources
,
Institutes
]
...
...
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