Update partitioning

This commit is contained in:
Thelonius Kort
2023-01-14 22:01:21 +01:00
parent d7325d64c5
commit 705c7d2b53
2 changed files with 21 additions and 17 deletions

View File

@ -14,7 +14,9 @@ defmodule Outlook.InternalTree.RawInternalBasic do
def set_split_markers([ %InternalNode{type: :text} = textnode | rest ]) do
[ %InternalNode{textnode |
content: textnode.content
|> String.replace(~r/([[:upper:]\d])\.(\d)?/u, "\\1#{@nonperiodmarker}\\2")
|> String.replace(~r/\.\.\.+/u, "")
|> String.replace(~r/([[:upper:]])\./u, "\\1#{@nonperiodmarker}")
|> String.replace(~r/(\d)\.(\d)/u, "\\1#{@nonperiodmarker}\\2")
|> String.replace(~r|([.?!]["'”]?\s*)|u, "\\1#{@splitmarker}")
|> String.replace(@nonperiodmarker, ".")
} | set_split_markers(rest) ]