Skip to contentSkip to conversation

punctcheck.pl updates

PATCH Superseded Akira Yokosawa 1 participant 3 messages Apr 4, 2022

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover punctcheck.pl updates

Hi Paul,

So, this series adds patterns in punctcheck.pl to detect misuses of punctuation markers "\@.", ".\@", and its friends.

Patch 1/3 adds the new pattern.
Patch 2/3 adds hint messages to help you and other contributors see what is wrong. Hopefully the added messages are clear enough. Patch 3/3 fixes existing misuses detected by the added pattern.

Thanks, Akira
--
Akira Yokosawa (3):
punctcheck.pl: Add pattern to catch reverse use of period markers punctcheck.pl: Add hints in complaint messages
Fix period markers

 glossary.tex            |  2 +-
 memorder/memorder.tex   |  2 +-
 together/applyrcu.tex   |  2 +-
 utilities/punctcheck.pl | 15 +++++++++++++++
 4 files changed, 18 insertions(+), 3 deletions(-)

base-commit: 5f28b7cb0d4c447c9d6397770906c7cb4c96832c

Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/3 punctcheck.pl: Add pattern to catch reverse use of period marker

End-of-sentence markers ("\@.", "\@?", etc.) make sense when they follow uppercase letters.
Mid-sentence markers (".\@", "?\@", etc. ) make sense when they follow lowercase letters.

Add patterns to cache misuses of them.

---
 utilities/punctcheck.pl | 6 ++++++
 1 file changed, 6 insertions(+)
utilities/punctcheck.pl +6 -0
index 7d23cc57..8820bf9c 100755
@@ -91,6 +91,12 @@ sub check_line {
 	if ($line =~ /^(?=[\s]*+[^%])[^%]*\\\@[\.\?\!\:][\)\}\']*\s+[^%]/){
 	    $ng += 1;
 	}
+	if ($line =~ /[a-z][\)\}\']*\\\@[\.\?\!\:][\)\}\']*\s/) {
+	    $ng += 1;
+	}
+	if ($line =~ /[A-Z][\)\}\']*[\.\?\!\:]\\\@[\)\}\']*\s/) {
+	    $ng += 1;
+	}
 	if ($ng) {
 	    print $ARGV[0], ':', $line_num, ':', $line_raw;
 	}
Signature · 1 line
2.25.1
#2 lore raw
In reply to Akira Yokosawa
Quoted 8 lines · Akira Yokosawa

Hi Paul,

So, this series adds patterns in punctcheck.pl to detect misuses of punctuation markers "\@.", ".\@", and its friends.

Patch 1/3 adds the new pattern.
Patch 2/3 adds hint messages to help you and other contributors see what is wrong. Hopefully the added messages are clear enough.

I noticed some typos in the added messages just before sending this. I'll send a v2 soon.

Thanks, Akira

Quoted 17 lines

Patch 3/3 fixes existing misuses detected by the added pattern.

Thanks, Akira
--
Akira Yokosawa (3):
punctcheck.pl: Add pattern to catch reverse use of period markers punctcheck.pl: Add hints in complaint messages
Fix period markers

 glossary.tex            |  2 +-
 memorder/memorder.tex   |  2 +-
 together/applyrcu.tex   |  2 +-
 utilities/punctcheck.pl | 15 +++++++++++++++
 4 files changed, 18 insertions(+), 3 deletions(-)

base-commit: 5f28b7cb0d4c447c9d6397770906c7cb4c96832c