Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pubmed
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
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
gargantext
crawlers
pubmed
Commits
ba743a17
Commit
ba743a17
authored
Mar 03, 2022
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CLEAN] removing unused code
parent
12cb16c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
102 deletions
+0
-102
Parser.hs
src/PUBMED/Parser.hs
+0
-102
No files found.
src/PUBMED/Parser.hs
View file @
ba743a17
...
...
@@ -111,108 +111,6 @@ parsePubMed txt = catMaybes $ txt ^.. pubmedArticle . to pubMed
lastName
=
namedEl
"LastName"
.
TTL
.
contents
affiliation
=
namedEl
"AffiliationInfo"
.
namedEl
"Affiliation"
.
TTL
.
contents
--identity :: a -> a
--identity x = x
--
--manyTagsUntil :: MonadThrow m =>
-- Name
-- -> ConduitT Event o m b
-- -> ConduitT Event o m (Maybe b)
--manyTagsUntil name f = do
-- _ <- manyTagsUntil_ name
-- tagIgnoreAttrs (matching (== name)) f
--
---- | Utility function that matches everything but the tag given
--tagUntil :: Name -> NameMatcher Name
--tagUntil name = matching (/= name)
--
---- | Utility function that consumes everything but the tag given
---- usefull because we have to consume every data.
--manyTagsUntil_ :: MonadThrow m => Name -> ConduitT Event o m ()
--manyTagsUntil_ n = many_ ( ignoreTree (tagUntil n) ignoreAttrs)
--
--manyTagsUntil_' :: MonadThrow m => Name -> ConduitT Event o m ()
--manyTagsUntil_' = many_ . ignoreEmptyTag . tagUntil
--parseDocId :: C.Cursor -> [Integer]
--parseDocId cursor = fst <$>
-- rights (T.decimal
-- <$> filter notNullOrEOL (rawElement cursor)
-- )
-- where rawElement = C.element "eSearchResult" C.&/ C.element "IdList" C.&// C.content
-- notNullOrEOL t = not (T.null t) && t /= "\n"
--readPubMedFile :: FilePath -> IO [PubMed]
--readPubMedFile fp = do
-- input <- DBL.readFile fp
-- pubMedParser input
--pubMedParser :: DBL.ByteString -> IO [PubMed]
--pubMedParser bstring = runConduit $ parseLBS def bstring
-- .| parseArticleSet
-- .| CL.consume
--
--parseArticleSet :: MonadThrow m => ConduitT Event PubMed m ()
--parseArticleSet =
-- force "PubmedArticleSet required" $ manyTagsUntil "PubmedArticleSet" $ manyYield parsePubMedArticle
--
--parsePubMedArticle :: MonadThrow m => ConduitT Event o m (Maybe PubMed)
--parsePubMedArticle =
-- manyTagsUntil "PubmedArticle" parsePubMedArticle'
--
--parsePubMedArticle' :: MonadThrow m => ConduitT Event o m PubMed
--parsePubMedArticle' = do
-- article <- force "MedlineCitation" $ tagIgnoreAttrs "MedlineCitation" parseMedlineCitation
-- dates <- tagIgnoreAttrs "PubmedData" $ do
-- dates' <- tagIgnoreAttrs "History" $ many $ tagIgnoreAttrs "PubMedPubDate" $ do
-- y' <- force "Year" $ tagIgnoreAttrs "Year" content
-- m' <- force "Month" $ tagIgnoreAttrs "Month" content
-- d' <- force "Day" $ tagIgnoreAttrs "Day" content
-- _ <- many ignoreAnyTreeContent
-- return (read $ unpack y', read $ unpack m', read $ unpack d')
-- _ <- many ignoreAnyTreeContent
-- return dates'
-- _ <- many ignoreAnyTreeContent
-- let (y,m,d) = maybe (1,1,1) (fromJust . head) (reverse <$> join dates)
-- return $ PubMed article (PubMedDate (jour y m d) y m d)
--
--parseMedlineCitation :: MonadThrow m => ConduitT Event o m PubMedArticle
--parseMedlineCitation = do
-- a <- force "article" $ manyTagsUntil "Article" parseArticle
-- _ <- many ignoreAnyTreeContent
-- return a
--
--parseArticle :: MonadThrow m => ConduitT Event o m PubMedArticle
--parseArticle = do
-- journal <- force "journal" $
-- manyTagsUntil "Journal" $ do
-- j <- manyTagsUntil "Title" content
-- _ <- many ignoreAnyTreeContent
-- return j
--
-- title <- manyTagsUntil "ArticleTitle" content
--
-- abstracts <- manyTagsUntil "Abstract" . many $ do
-- txt <- tagIgnoreAttrs "AbstractText" content
-- _ <- many ignoreAnyTreeContent
-- return txt
-- -- TODO add authos
--
-- authors <- manyTagsUntil "AuthorList" . many $
-- tagIgnoreAttrs "Author" $ do
-- ln <- manyTagsUntil "LastName" content
-- fn <- manyTagsUntil "ForeName" content
-- affi <- manyTagsUntil "AffiliationInfo" $ do
-- aff <- manyTagsUntil "Affiliation" content
-- _ <- many ignoreAnyTreeContent
-- return aff
-- _ <- many ignoreAnyTreeContent
-- return Author {lastName=ln, foreName=fn, affiliation=fromMaybe Nothing affi}
--
--
-- _ <- many ignoreAnyTreeContent
-- return $ PubMedArticle title journal abstracts authors
pubMedData
::
DBL
.
ByteString
pubMedData
=
mconcat
...
...
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