Skip to content

Commit

Permalink
feat(filters): Catch English dates as exception to sentence filter
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Aug 22, 2024
1 parent 910898f commit 3b222aa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pandoc-filters/sentence_lines.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ end

local function is_en_exception (previous, next)
if tr_non_terminal[previous] then return true end
-- Dates (reverse from most common order, but other way harder to match without negatives)
if previous:match("A%.?D%.$") and next:match("^%d") then return true end
if previous:match("B%.?C%.$") and next:match("^%d") then return true end
if previous:match("C%.?E%.$") and next:match("^%d") then return true end
if previous:match("B%.?C%.?E%.$") and next:match("^%d") then return true end
-- Verse refs, e.g. Gen. 16
if previous:match("^%u%P+%.$") and next:match("^%d") then return true end
end
Expand Down

0 comments on commit 3b222aa

Please sign in to comment.