From eba8ba512f903f556f97cf5ce286fecab6e427e2 Mon Sep 17 00:00:00 2001 From: crep Date: Wed, 27 Oct 2010 21:49:25 +0200 Subject: [PATCH] Utils: add script for typo correction depending on language --- utils/typo.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 utils/typo.sh diff --git a/utils/typo.sh b/utils/typo.sh new file mode 100755 index 00000000..e7ae3c63 --- /dev/null +++ b/utils/typo.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +#Author: Romain Goffe +#Date: 27/10/2010 +#Description: apply typo rules depending on language for songs (.sg files) +#Commentary: to be merge with latex-preprocessing script + +for song in songs/*/*.sg; do + if grep -q "selectlanguage{english}" $song + then + sed -i "s/ ?/?/g" $song; + sed -i "s/ !/!/g" $song; + sed -i "s/ :/:/g" $song; + fi; + if grep -q "selectlanguage{french}" $song + then + sed -i "s/?/ ?/g" $song; + sed -i "s/ ?/ ?/g" $song; + sed -i "s/!/ !/g" $song; + sed -i "s/ !/ !/g" $song; + sed -i "s/:/ :/g" $song; + sed -i "s/ :/ :/g" $song; + fi; +done;