fix(unitproc/bkt-replace_apos):Handle possessive 's and s'
[BK-2020-03.git] / unitproc / bkt-replace_apos
similarity index 97%
rename from unitproc/bkt-replace_apostrophes
rename to unitproc/bkt-replace_apos
index 4e6c95b36de3a028e43c1a49ea1c2dba7956bd3d..1ba50fc2214bc8d4270a5a3f8370b73cbaffa237 100644 (file)
@@ -8,7 +8,7 @@ function replace_apostrophes() {
     # Input: stdin
     #        arg1   file path
     # Output: stdout
     # Input: stdin
     #        arg1   file path
     # Output: stdout
-    # Version: 1.0.0 (BK-2020-03)
+    # Version: 1.1.0 (BK-2020-03)
     # Depends: GNU sed 4.8
 
     # Check input
     # Depends: GNU sed 4.8
 
     # Check input
@@ -64,7 +64,8 @@ function replace_apostrophes() {
         -e "s/(she|She|SHE)'(d|D|ll|LL)'(ve|VE)/\1ʼ\2ʼ\3/g" \
         -e "s/(she|She|SHE)'(d|D|ll|LL|s|S)/\1ʼ\2/g" \
         -e "s/(shan|Shan|SHAN)'(t|T)/\1ʼ\2/g" \
         -e "s/(she|She|SHE)'(d|D|ll|LL)'(ve|VE)/\1ʼ\2ʼ\3/g" \
         -e "s/(she|She|SHE)'(d|D|ll|LL|s|S)/\1ʼ\2/g" \
         -e "s/(shan|Shan|SHAN)'(t|T)/\1ʼ\2/g" \
-        -e "s/'(s\b)/ʼ\1/g" \
+        -e "s/'(s|S)\b/ʼ\1/g" \
+        -e "s/(s|S)'( |$)/\1ʼ\2/g" \
         -e "s/(oughtn|Oughtn|OUGHTN)'(t|T)'(ve|VE)/\1ʼ\2ʼ\3/g" \
         -e "s/(oughtn|Oughtn|OUGHTN)'(t|T)/\1ʼ\2/g" \
         -e "s/(o|O)'(clock|CLOCK)/\1ʼ\2/g" \
         -e "s/(oughtn|Oughtn|OUGHTN)'(t|T)'(ve|VE)/\1ʼ\2ʼ\3/g" \
         -e "s/(oughtn|Oughtn|OUGHTN)'(t|T)/\1ʼ\2/g" \
         -e "s/(o|O)'(clock|CLOCK)/\1ʼ\2/g" \