From bbb1a0f5eb73581861cc33c6046c41ac7fe473ea Mon Sep 17 00:00:00 2001 From: Andrew Paseltiner Date: Mon, 15 Jul 2024 11:35:31 -0400 Subject: [PATCH] Remove duplicate matches for s-103 --- se/se_epub_lint.py | 2 +- tests/lint/semantic/s-103/golden/s-103-out.txt | 18 ++++++------------ .../s-103/in/src/epub/text/chapter-1.xhtml | 2 -- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/se/se_epub_lint.py b/se/se_epub_lint.py index b87c11cb..095e08b3 100644 --- a/se/se_epub_lint.py +++ b/se/se_epub_lint.py @@ -2248,7 +2248,7 @@ def _lint_xhtml_syntax_checks(self, filename: Path, dom: se.easy_xml.EasyXmlTree # Check for common missing roman semantics for “I” regent_regex = r"(?:Charles|Edward|George|Henry|James|William) I\b" - matches = regex.findall(fr"King {regent_regex}", file_contents) + regex.findall(fr"{regent_regex}’s", file_contents) + matches = regex.findall(fr"King {regent_regex}|{regent_regex}’s", file_contents) if matches: messages.append(LintMessage("s-103", "Probable missing semantics for a roman I numeral.", se.MESSAGE_TYPE_WARNING, filename, matches)) diff --git a/tests/lint/semantic/s-103/golden/s-103-out.txt b/tests/lint/semantic/s-103/golden/s-103-out.txt index 6e316594..9d6cc84f 100644 --- a/tests/lint/semantic/s-103/golden/s-103-out.txt +++ b/tests/lint/semantic/s-103/golden/s-103-out.txt @@ -1,5 +1,11 @@ s-103 [Manual Review] chapter-1.xhtml Probable missing semantics for a roman I numeral. + Charles I’s + Edward I’s + George I’s + Henry I’s + James I’s + William I’s King Charles I King Edward I King George I @@ -12,15 +18,3 @@ numeral. King Henry I King James I King William I - Charles I’s - Edward I’s - George I’s - Henry I’s - James I’s - William I’s - Charles I’s - Edward I’s - George I’s - Henry I’s - James I’s - William I’s diff --git a/tests/lint/semantic/s-103/in/src/epub/text/chapter-1.xhtml b/tests/lint/semantic/s-103/in/src/epub/text/chapter-1.xhtml index f5875457..f0384943 100644 --- a/tests/lint/semantic/s-103/in/src/epub/text/chapter-1.xhtml +++ b/tests/lint/semantic/s-103/in/src/epub/text/chapter-1.xhtml @@ -18,8 +18,6 @@

King Henry I.

King James I.

King William I.

-

King Charles I’s.

King Edward I’s.

King George I’s.