From 2bd164983673051bec6ac1dbc9efc84c4d06cb56 Mon Sep 17 00:00:00 2001 From: Christopher Cox Date: Fri, 17 May 2024 18:28:36 -0400 Subject: [PATCH] Parse spaces in LHS/RHS forms, making sure they are quoted appropriately in the output --- tools/shellscripts/pairs2lexc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/shellscripts/pairs2lexc.sh b/tools/shellscripts/pairs2lexc.sh index 255384c7..411372b4 100755 --- a/tools/shellscripts/pairs2lexc.sh +++ b/tools/shellscripts/pairs2lexc.sh @@ -6,7 +6,7 @@ # Usage: cat pairs.txt | ./pairs2lexc.sh > pairs.lexc -gawk 'BEGIN { output="LEXICON Root\n"; } +gawk 'BEGIN { FS="\t"; output="LEXICON Root\n"; } { output=output sprintf("%s:%s # ;\n", $1, $2); while(match($1,"\\+([^\\+]+)",t)!=0) { mchars["+"t[1]]++; sub("\\+"t[1],""); } @@ -15,4 +15,4 @@ END { print "Multichar_Symbols"; for(i in mchars) print i; print ""; print output; -}' +}' | sed "s/ \([^#\;]\)/% \\1/g;s/LEXICON% Root/LEXICON Root/g"