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
637e9261
Commit
637e9261
authored
Sep 18, 2024
by
Grégoire Locqueville
Committed by
Grégoire Locqueville
Oct 07, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove obsolete GargV3-related code
parent
0ad09936
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
65 deletions
+0
-65
TSV.hs
src/Gargantext/Core/Text/Corpus/Parsers/TSV.hs
+0
-65
No files found.
src/Gargantext/Core/Text/Corpus/Parsers/TSV.hs
View file @
637e9261
...
...
@@ -45,71 +45,6 @@ headerTsvGargV3 =
,
"authors"
]
---------------------------------------------------------------
data
TsvGargV3
=
TsvGargV3
{
d_docId
::
!
Int
,
d_title
::
!
Text
,
d_source
::
!
Text
,
d_publication_year
::
!
Int
,
d_publication_month
::
!
Int
,
d_publication_day
::
!
Int
,
d_abstract
::
!
Text
,
d_authors
::
!
Text
}
deriving
(
Show
)
---------------------------------------------------------------
-- | Doc 2 HyperdataDocument
toDoc
::
TsvGargV3
->
HyperdataDocument
toDoc
(
TsvGargV3
did
dt
_
dpy
dpm
dpd
dab
dau
)
=
HyperdataDocument
{
_hd_bdd
=
Just
"TSV"
,
_hd_doi
=
Just
.
pack
.
show
$
did
,
_hd_url
=
Nothing
,
_hd_page
=
Nothing
,
_hd_title
=
Just
dt
,
_hd_authors
=
Nothing
,
_hd_institutes
=
Just
dau
,
_hd_source
=
Just
dab
,
_hd_abstract
=
Nothing
,
_hd_publication_date
=
Nothing
,
_hd_publication_year
=
Just
dpy
,
_hd_publication_month
=
Just
dpm
,
_hd_publication_day
=
Just
dpd
,
_hd_publication_hour
=
Nothing
,
_hd_publication_minute
=
Nothing
,
_hd_publication_second
=
Nothing
,
_hd_language_iso2
=
Nothing
,
_hd_institutes_tree
=
Nothing
}
---------------------------------------------------------------
-- | Types Conversions
toDocs
::
Vector
TsvDoc
->
[
TsvGargV3
]
toDocs
v
=
V
.
toList
$
V
.
zipWith
(
\
nId
(
TsvDoc
{
..
})
-- (TsvDoc t s mPy pm pd abst auth)
->
TsvGargV3
{
d_docId
=
nId
,
d_title
=
tsv_title
,
d_source
=
tsv_source
,
d_publication_year
=
fromMIntOrDec
defaultYear
tsv_publication_year
,
d_publication_month
=
fromMaybe
defaultMonth
tsv_publication_month
,
d_publication_day
=
fromMaybe
defaultDay
tsv_publication_day
,
d_abstract
=
tsv_abstract
,
d_authors
=
tsv_authors
})
(
V
.
enumFromN
1
(
V
.
length
v''
))
v''
where
v''
=
V
.
foldl
(
\
v'
sep
->
V
.
concatMap
(
splitDoc
(
docsSize
v'
)
sep
)
v'
)
v
seps
seps
=
V
.
fromList
[
Paragraphs
1
,
Sentences
3
,
Chars
3
]
---------------------------------------------------------------
fromDocs
::
Vector
TsvGargV3
->
Vector
TsvDoc
fromDocs
=
V
.
map
fromDocs'
where
fromDocs'
(
TsvGargV3
{
..
})
=
TsvDoc
{
tsv_title
=
d_title
,
tsv_source
=
d_source
,
tsv_publication_year
=
Just
$
IntOrDec
d_publication_year
,
tsv_publication_month
=
Just
d_publication_month
,
tsv_publication_day
=
Just
d_publication_day
,
tsv_abstract
=
d_abstract
,
tsv_authors
=
d_authors
}
---------------------------------------------------------------
-- | Split a document in its context
-- TODO adapt the size of the paragraph according to the corpus average
splitDoc
::
Mean
->
SplitContext
->
TsvDoc
->
Vector
TsvDoc
...
...
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