feat: Add eof heuristic for readera extractor
Every exported ReadEra annotation file also _ends_ with the ubiquitous `*****` pattern, so we look for that to detect the file.
This commit is contained in:
parent
3ef45e24f7
commit
5f01aa1f2b
2 changed files with 32 additions and 2 deletions
|
|
@ -24,11 +24,16 @@ class ReadEraExtractor:
|
|||
if not content:
|
||||
return False
|
||||
|
||||
# look for title and author lines up top
|
||||
if not content[0] or not content[1]:
|
||||
return False
|
||||
|
||||
patt = re.compile(r"\n\*\*\*\*\*\n")
|
||||
if not patt.search("".join(content)):
|
||||
# look for star-shaped divider pattern
|
||||
if not re.search(r"\n\*\*\*\*\*\n", "".join(content)):
|
||||
return False
|
||||
|
||||
# look for star-shaped pattern at end of file
|
||||
if not re.search(r"\n\*\*\*\*\*\n\n$", "".join(content)):
|
||||
return False
|
||||
|
||||
logger.debug(
|
||||
|
|
|
|||
25
tests/extractors/ReadEra_sample.txt
Normal file
25
tests/extractors/ReadEra_sample.txt
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
The Circle of the Snake
|
||||
Grafton Tanner
|
||||
|
||||
digital technologies of the twenty-first century can only exist thanks to this kind of outsourced labor. The relative invisibility of the tech supply chain is part of the ruse; American consumers do not see where smartphones come from. They do not see the conflict zones where coltan is mined to be used in electronic devices, or the sweatshops in which digital products are manufactured. The latest technologies arrive instead in pristine condition, as if delivered from on high.
|
||||
|
||||
*****
|
||||
|
||||
We don’t necessarily want our leaders to be average persons like us, even though we often enjoy hearing that famous celebrities eat the same fast food as regular people. But in the beginning of the twenty-first century, we carefully watch our public figures to ensure they do not commit an unconscionable act. Doing so helps to rid the public stage of bigots, even as it also threatens the last known walls of privacy. This is an inevitable tension that must be maintained as we open the door on the private lives of others
|
||||
--We continuously demystify our leaders - first through television, now through social media, streams, docus, etc. this brings them down to our level, which is what this paragraph talks about
|
||||
|
||||
*****
|
||||
|
||||
Initially, the Internet was praised as a freer way to encounter information. In the early 1990s, digital theorist George Landow saw hypertext as a liberatory reading strategy.¹⁶ He embraced it as a common good and thought hyperlinks would emancipate readers from the prison of the fixed word, allowing them to flow freely between various information sources. But what Landow never imagined is the exhaustion that could come from the endless, rootless process of reading in this way. Not everyone wants to jump from point to point without any center. Infinity might not always be alluring.
|
||||
Landow puts the agency in the reader when he writes, ‘anyone who uses hypertext makes his or her own interests the de facto organizing principle (or center) for the investigation at the moment.’¹⁷ But how much agency do we actually have when falling down the rabbit hole? What if we get lost in the hole where the center was? How much attention do we end up losing in a world where we must always multi-task and where reading itself is disrupted by one hyperlink after another? And who
|
||||
|
||||
*****
|
||||
|
||||
In the Dust of This Planet
|
||||
Horror of Philosophy vol. 1
|
||||
Eugene Thacker
|
||||
In the first of a series of three books on the Horror of Philosophy,In the Dust of This Planetoffers the genre of horror as a way of thinking about the unthinkable.
|
||||
Paperback: 978-1-84694-676-9 ebook: 978-1-78099-010-1
|
||||
|
||||
*****
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue