[PATCH 1/2] hyphen2endash.sh: Add substitution patterns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From 37577e84f4215305195e471df9443ac2f242f595 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <akiyks@xxxxxxxxx>
Date: Sun, 4 Sep 2016 00:14:09 +0900
Subject: [PATCH 1/2] hyphen2endash.sh: Add substitution patterns

This commit adds substitution patterns for the following:
  o CPUs~nn--mm
  o \co{xxx}--\co{yyy}

It also separates the pattern for "and~nn--mm".

This commit also fixes typo in author's email address.

Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx>
---
 utilities/dohyphen2endash.sh |  2 +-
 utilities/hyphen2endash.sh   | 14 +++++++++++---
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/utilities/dohyphen2endash.sh b/utilities/dohyphen2endash.sh
index 2a0fdc7..fabecb5 100644
--- a/utilities/dohyphen2endash.sh
+++ b/utilities/dohyphen2endash.sh
@@ -21,7 +21,7 @@
 #
 # Copyright (C) Akira Yokosawa, 2016
 #
-# Authors: Akira Yokosawa <akiyks@xxxxxxxxx>
+# Authors: Akira Yokosawa <akiyks@xxxxxxxxx>
 
 # parse option
 TEMP=`getopt -o f --long force -- "$@"`
diff --git a/utilities/hyphen2endash.sh b/utilities/hyphen2endash.sh
index 2b37696..b495e33 100644
--- a/utilities/hyphen2endash.sh
+++ b/utilities/hyphen2endash.sh
@@ -11,9 +11,13 @@
 # Line nn-mm -> Lines~nn--mm  -- includes typo fix
 # line~nn-mm -> lines~nn--mm  -- includes typo fix
 # Line~nn-mm -> Lines~nn--mm  -- includes typo fix
-# Lines~nn--mm and oo-pp -> Lines~nn--mm and oo--pp
 # Slides nn-mm -> Slides~nn--mm
+# CPUs~nn-mm -> CPUs~nn--mm
+# CPUs nn-mm -> CPUs~nn--mm
+# and nn-mm -> and~nn--mm
+# and~nn-mm -> and~nn--mm
 # Figures~\ref{foo}-\ref{bar} -> Figures~\ref{foo}--\ref{bar}
+# \co{xxx}-\{yyy} -> \co{xxx}--\co{yyy}
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -31,7 +35,7 @@
 #
 # Copyright (C) Akira Yokosawa, 2016
 #
-# Authors: Akira Yokosawa <akiyks@xxxxxxxxx>
+# Authors: Akira Yokosawa <akiyks@xxxxxxxxx>
 
 cat $1 |
 	sed -e 's/Lines~\([0-9]\+\)-\([0-9]\+\)/Lines~\1--\2/g' \
@@ -42,9 +46,13 @@ cat $1 |
 	    -e 's/Line \([0-9]\+\)-\([0-9]\+\)/Lines~\1--\2/g' \
 	    -e 's/line~\([0-9]\+\)-\([0-9]\+\)/lines~\1--\2/g' \
 	    -e 's/line \([0-9]\+\)-\([0-9]\+\)/lines~\1--\2/g' \
-	    -e 's/Lines~\([0-9]\+\)--\([0-9]\+\) and \([0-9]\+\)-\([0-9]\+\)/Lines~\1--\2 and \3--\4/g' \
 	    -e 's/Slides \([0-9]\+\)-\([0-9]\+\)/Slides~\1--\2/g' \
 	    -e 's/Figures~\(\\ref{.*}\)-\(\\ref{.*}\)/Figures~\1--\2/g' \
+	    -e 's/CPUs~\([0-9]\+\)-\([0-9]\+\)/CPUs~\1--\2/g' \
+	    -e 's/CPUs \([0-9]\+\)-\([0-9]\+\)/CPUs~\1--\2/g' \
+	    -e 's/and~\([0-9]\+\)-\([0-9]\+\)/and~\1--\2/g' \
+	    -e 's/and \([0-9]\+\)-\([0-9]\+\)/and~\1--\2/g' \
+	    -e 's/\(\\co{.*}\)-\(\\co{.*}\)/\1--\2/g' \
 	    -e 's/\/\* Lines~\([0-9]\+\)--\([0-9]\+\) \*\//\/\* Lines \1-\2 \*\//g'
 
 # Last pattern is to preserve "Lines n-m" in comments within code snippet
-- 
1.9.1


--
To unsubscribe from this list: send the line "unsubscribe perfbook" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux