Commit 637e9261 authored by Grégoire Locqueville's avatar Grégoire Locqueville Committed by Grégoire Locqueville

Remove obsolete GargV3-related code

parent 0ad09936
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment