Skip to content
Snippets Groups Projects
Commit c5866d55 authored by Alice Brenon's avatar Alice Brenon
Browse files

Give a meaningful name to a zipper function in the script to split articles into paragraphs

parent 88e41133
No related branches found
No related tags found
No related merge requests found
......@@ -18,12 +18,13 @@ articleParagraphs =
fmap (fmap (leave . linearize False . enter) . splitOn "\n\n") . Text.readFile
withMeta :: ArticleRecord @ Entry -> [Text] -> [(ParagraphMeta, Text)]
withMeta (articleRecord :@: entry) paragraphs = zipWith f [1..] paragraphs
withMeta (articleRecord :@: entry) paragraphs =
zipWith numberParagraph [1..] paragraphs
where
prodigyMeta = ProdigyMeta
{ totalParagraphs = length paragraphs
, Prodigy.headword = Article.headword entry }
f paragraph paragraphText =
numberParagraph paragraph paragraphText =
(articleRecord :@: Paragraph {paragraph} :@: prodigyMeta, paragraphText)
to :: FilePath -> FilePath -> ArticleRecord @ Entry -> IO [ParagraphMeta]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment