diff options
| author | WriterV2 <primary-v2@protonmail.com> | 2023-04-02 14:14:57 +0200 |
|---|---|---|
| committer | WriterV2 <primary-v2@protonmail.com> | 2023-04-02 14:14:57 +0200 |
| commit | e5c4a7b348acf95bb9700d0dfac3f98ba5ed2742 (patch) | |
| tree | 9d36da788c18d6c5d52d985a33e05de4a7c1319d /src/works | |
| parent | b38de27edc6fa2d6ca5ce8b7ef701a06d0e5f3a4 (diff) | |
Clean up
Diffstat (limited to 'src/works')
| -rw-r--r-- | src/works/stories.rs | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/works/stories.rs b/src/works/stories.rs index 943f079..a38a7c0 100644 --- a/src/works/stories.rs +++ b/src/works/stories.rs @@ -71,29 +71,6 @@ impl Story { // extract text from pdf document fn get_text(&self) -> anyhow::Result<String> { - // TODO: - // - 1-2 digit number with linebreak e.g. "Es ist 10\n geworden" not usable in texts - // - currently only linebreaks before quotes, but not after paragraphs - /* - let mut text = - pdf_extract::extract_text(format!("docs/stories/{}", &self.path_to_document))?; - - text = regex::Regex::new(r"\n\n»")? - .replace_all(&text, "<br>»") - .to_string(); - text = regex::Regex::new(r"\d{1,2}?\n \d")? - .replace_all(&text, "") - .to_string(); - text = regex::Regex::new(r"-?\d{1,2}\n")? - .replace_all(&text, "") - .to_string(); - text = regex::Regex::new(r"-\n\n")? - .replace_all(&text, "") - .to_string(); - text = regex::Regex::new("\n\n")? - .replace_all(&text, " ") - .to_string(); - */ let text = std::fs::read_to_string(format!("stories_html/{}.html", self.path_to_document.replace(".pdf", "")))?; anyhow::Ok(text).with_context(|| format!("Failed to extract text for {}", self.title)) |
