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

Quickfix to split LGE article in approximate paragraphs

parent 8ce473eb
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env -S runhaskell --ghc-arg="-Wall" --ghc-arg="-i lib"
import Data.Char (isUpper)
import Data.Char (isUpper, isLower)
import System.Environment (getArgs)
import System.Script (syntax)
import Text.Filter (xargs)
......@@ -9,6 +9,9 @@ linearize :: String -> String
linearize "" = ""
linearize ('¬':'\n':s) = linearize s
linearize ('\n':'\n':s) = "\n\n" ++ linearize s
linearize ('.':'\n':c0:c1:c2:s)
| isUpper c0 && isLower c1 && isLower c2 = ".\n\n" ++ c0:c1:c2:linearize s
linearize ('.':'\n':'—':s) = ".\n\n—" ++ linearize s
linearize ('\n':s) = ' ' : linearize s
linearize ('-':'\n':c:s)
| isUpper c = '-' : c : linearize s
......
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