change compare and title heads

change compare and title heads

git-svn-id: 293778eaa97c8c94097d610b1bd5133a8f478f36@22130 4f837ed2-42f5-46e7-a7a5-fa17313484d4

--- scripts/tdb/statuses_clockss.awk
+++ scripts/tdb/statuses_clockss.awk
@@ -17,7 +17,8 @@
     incontract = 1
   }

-  if (incontract == 1) {
+  if ((substr($4,1,4) >= $3) || ((length($4) == 9) && (substr($4,6,4) >= $3))) {
+  #if (incontract == 1) {
       nn = split($2,na,/\./)
       lp2 = na[nn]
     if (!(($1,lp2,$3,$4) in b)) {


LanguageData: update section K

LanguageData: update section K

--- include/LanguageData.awk
+++ include/LanguageData.awk
@@ -1178,9 +1178,7 @@
     Locale["jv"]["spoken-in"]          = "Java, Indonesia"
     Locale["jv"]["supported-by"]       = "google; yandex"

-
-
-    #46 Kannada (Modern Kannada)
+    # Kannada (Modern Kannada)
     Locale["kn"]["name"]               = "Kannada"
     Locale["kn"]["endonym"]            = "ಕನ್ನಡ"
     Locale["kn"]["translations-of"]    = "%s ನ ಅನುವಾದಗಳು"
@@ -1189,11 +1187,14 @@
     Locale["kn"]["examples"]           = "ಉದಾಹರಣೆಗಳು"
     Locale["kn"]["see-also"]           = "ಇದನ್ನೂ ಗಮನಿಸಿ"
     Locale["kn"]["family"]             = "Dravidian"
+    Locale["kn"]["branch"]             = "South Dravidian"
     Locale["kn"]["iso"]                = "kan"
     Locale["kn"]["glotto"]             = "nucl1305"
     Locale["kn"]["script"]             = "Knda"
-
-    #47 Kazakh, Cyrillic alphabet
+    Locale["kn"]["spoken-in"]          = "the southwestern India"
+    Locale["kn"]["supported-by"]       = "google; bing; yandex"
+
+    # Kazakh, Cyrillic alphabet
     Locale["kk"]["name"]               = "Kazakh"
     Locale["kk"]["endonym"]            = "Қазақ тілі"
     Locale["kk"]["translations-of"]    = "%s аудармалары"
@@ -1202,11 +1203,14 @@
     Locale["kk"]["examples"]           = "Мысалдар"
     Locale["kk"]["see-also"]           = "Келесі тізімді де көріңіз:"
     Locale["kk"]["family"]             = "Turkic"
+    Locale["kk"]["branch"]             = "Kipchak"
     Locale["kk"]["iso"]                = "kaz"
     Locale["kk"]["glotto"]             = "kaza1248"
     Locale["kk"]["script"]             = "Cyrl"
-
-    #48 Khmer (Central Khmer)
+    Locale["kk"]["spoken-in"]          = "Kazakhstan; China; Mongolia; Russia; Kyrgyzstan; Uzbekistan"
+    Locale["kk"]["supported-by"]       = "google; bing; yandex"
+
+    # Khmer (Central Khmer)
     Locale["km"]["name"]               = "Khmer"
     Locale["km"]["endonym"]            = "ភាសាខ្មែរ"
     Locale["km"]["translations-of"]    = "ការបកប្រែនៃ %s"
@@ -1215,11 +1219,14 @@
     Locale["km"]["examples"]           = "ឧទាហរណ៍"
     Locale["km"]["see-also"]           = "មើលផងដែរ"
     Locale["km"]["family"]             = "Austroasiatic"
+    Locale["km"]["branch"]             = "Khmeric"
     Locale["km"]["iso"]                = "khm"
     Locale["km"]["glotto"]             = "cent1989"
     Locale["km"]["script"]             = "Khmr"
-
-    #49 Kinyarwanda
+    Locale["km"]["spoken-in"]          = "Cambodia; Thailand; Vietnam"
+    Locale["km"]["supported-by"]       = "google; bing; yandex"
+
+    # Kinyarwanda
     Locale["rw"]["name"]               = "Kinyarwanda"
     Locale["rw"]["endonym"]            = "Ikinyarwanda"
     #Locale["rw"]["translations-of"]
@@ -1228,9 +1235,12 @@
     #Locale["rw"]["examples"]
     #Locale["rw"]["see-also"]
     Locale["rw"]["family"]             = "Atlantic-Congo"
+    Locale["rw"]["branch"]             = "Bantu"
     Locale["rw"]["iso"]                = "kin"
     Locale["rw"]["glotto"]             = "kiny1244"
     Locale["rw"]["script"]             = "Latn"
+    Locale["rw"]["spoken-in"]          = "Rwanda; Uganda; DR Congo; Tanzania"
+    Locale["rw"]["supported-by"]       = "google"

     # Konkani (Goan Konkani)
     Locale["gom"]["name"]              = "Konkani"
@@ -1241,11 +1251,14 @@
     #Locale["gom"]["examples"]
     #Locale["gom"]["see-also"]
     Locale["gom"]["family"]            = "Indo-European"
+    Locale["gom"]["branch"]            = "Indo-Aryan"
     Locale["gom"]["iso"]               = "gom"
     Locale["gom"]["glotto"]            = "goan1235"
     Locale["gom"]["script"]            = "Deva"
-
-    #50 Korean
+    Locale["gom"]["spoken-in"]         = "the western coastal region of India"
+    Locale["gom"]["supported-by"]      = "google"
+
+    # Korean
     Locale["ko"]["name"]               = "Korean"
     Locale["ko"]["endonym"]            = "한국어"
     Locale["ko"]["translations-of"]    = "%s의 번역"
@@ -1254,10 +1267,13 @@
     Locale["ko"]["examples"]           = "예문"
     Locale["ko"]["see-also"]           = "참조"
     Locale["ko"]["family"]             = "Koreanic"
+    #Locale["ko"]["branch"]
     Locale["ko"]["iso"]                = "kor"
     Locale["ko"]["glotto"]             = "kore1280"
     Locale["ko"]["script"]             = "Kore"
     Locale["ko"]["dictionary"]         = "true" # has dictionary
+    Locale["ko"]["spoken-in"]          = "South Korea; North Korea; China"
+    Locale["ko"]["supported-by"]       = "google; bing; yandex"

     # Krio
     Locale["kri"]["name"]              = "Krio"
@@ -1268,11 +1284,14 @@
     #Locale["kri"]["examples"]
     #Locale["kri"]["see-also"]
     Locale["kri"]["family"]            = "Indo-European"
+    Locale["kri"]["branch"]            = "English Creole"
     Locale["kri"]["iso"]               = "kri"
     Locale["kri"]["glotto"]            = "krio1253"
     Locale["kri"]["script"]            = "Latn"
-
-    #51 Kurdish (Northern) / Kurmanji
+    Locale["kri"]["spoken-in"]         = "Sierra Leone"
+    Locale["kri"]["supported-by"]      = "google"
+
+    # Kurdish (Northern Kurdish) / Kurmanji
     Locale["ku"]["name"]               = "Kurdish (Northern)"
     Locale["ku"]["name2"]              = "Kurmanji"
     Locale["ku"]["endonym"]            = "Kurmancî"
@@ -1283,11 +1302,14 @@
     #Locale["ku"]["examples"]
     #Locale["ku"]["see-also"]
     Locale["ku"]["family"]             = "Indo-European"
+    Locale["ku"]["branch"]             = "Iranian"
     Locale["ku"]["iso"]                = "kmr"
     Locale["ku"]["glotto"]             = "nort2641"
     Locale["ku"]["script"]             = "Latn"
-
-    # Kurdish (Central) / Sorani
+    Locale["ku"]["spoken-in"]          = "southeast Turkey; northwest and northeast Iran; northern Iraq; northern Syria; the Caucasus and Khorasan regions"
+    Locale["ku"]["supported-by"]       = "google"
+
+    # Kurdish (Central Kurdish) / Sorani
     Locale["ckb"]["name"]              = "Kurdish (Central)"
     Locale["ckb"]["name2"]             = "Sorani"
     Locale["ckb"]["endonym"]           = "سۆرانی"
@@ -1298,12 +1320,15 @@
     #Locale["ckb"]["examples"]
     #Locale["ckb"]["see-also"]
     Locale["ckb"]["family"]            = "Indo-European"
+    Locale["ckb"]["branch"]            = "Iranian"
     Locale["ckb"]["iso"]               = "ckb"
     Locale["ckb"]["glotto"]            = "cent1972"
     Locale["ckb"]["script"]            = "Arab"
     Locale["ckb"]["rtl"]               = "true" # RTL language
-
-    #52 Kyrgyz
+    Locale["ckb"]["spoken-in"]         = "Iraqi Kurdistan; western Iran"
+    Locale["ckb"]["supported-by"]      = "google"
+
+    # Kyrgyz, Cyrillic alphabet
     Locale["ky"]["name"]               = "Kyrgyz"
     Locale["ky"]["endonym"]            = "Кыргызча"
     Locale["ky"]["translations-of"]    = "%s котормосу"
@@ -1312,9 +1337,14 @@
     Locale["ky"]["examples"]           = "Мисалдар"
     Locale["ky"]["see-also"]           = "Дагы караңыз"
     Locale["ky"]["family"]             = "Turkic"
+    Locale["ky"]["branch"]             = "Kipchak"
     Locale["ky"]["iso"]                = "kir"
     Locale["ky"]["glotto"]             = "kirg1245"
     Locale["ky"]["script"]             = "Cyrl"
+    Locale["ky"]["spoken-in"]          = "Kyrgyzstan; China; Tajikistan; Afghanistan; Pakistan"
+    Locale["ky"]["supported-by"]       = "google; bing; yandex"
+
+

     #53 Lao
     Locale["lo"]["name"]               = "Lao"


Patch the JAVA_CLASSPATH_DEFAULT config value for Windows.  Ticket #2278.

--- src/condor_examples/convert_config_to_win32.awk
+++ src/condor_examples/convert_config_to_win32.awk
@@ -151,7 +151,12 @@

 # Win32 has a path separator of ';', while on Unix it is ':'
 /^JAVA_CLASSPATH_SEPARATOR/ {
-	printf "%s= ;\n", $1
+	printf "JAVA_CLASSPATH_SEPARATOR= ;\n", $1
+}
+
+# Win32 has the jar files located in the bin directory.
+/^JAVA_CLASSPATH_DEFAULT/ {
+	print "JAVA_CLASSPATH_DEFAULT = $(BIN) $(BIN)/scimark2lib.jar ."
 	next
 }


TestCommons: test unescape()

TestCommons: test unescape()

--- test/TestCommons.awk
+++ test/TestCommons.awk
@@ -114,6 +114,13 @@
         assertEqual(escape("\""), "\\\"")
         assertEqual(escape("\"foo\""), "\\\"foo\\\"")
     }
+    T("unescape()", 4)
+    {
+        assertEqual(unescape(""), "")
+        assertEqual(unescape("foo"), "foo")
+        assertEqual(unescape("\\\""), "\"")
+        assertEqual(unescape("\\\"foo\\\""), "\"foo\"")
+    }
     T("parameterize()", 10)
     {
         assertEqual(parameterize(""), "''")


cover lagging http://WWW.monarch

cover lagging http://WWW.monarch

--- scripts/ntriple2dot.awk
+++ scripts/ntriple2dot.awk
@@ -99,7 +99,9 @@
 	prefix["http://identifiers.org/wormbase"]="WormBase"
 	# till all non httpS: are purged
 	prefix["http://monarchinitiative.org/"]="BASE"
+	prefix["http://www.monarchinitiative.org/"]="BASE"
 	prefix["http://monarchinitiative.org/MONARCH_"]="MONARCH"
+	prefix["http://www.monarchinitiative.org/MONARCH_"]="MONARCH"
 }

 # main loop


x86: Fix objdump version check in arch/x86/tools/chkobjdump.awk

It says

Warning: objdump version  is older than 2.19
Warning: Skipping posttest.

because it used the wrong field from `objdump -v':

akpm:/usr/src/25> /opt/crosstool/gcc-4.0.2-glibc-2.3.6/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-objdump -v
GNU objdump 2.16.1
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.

Cc: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>
Cc: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
LKML-Reference: <607545bd897c66a62dce21eb4971ca6f2b40912e@imap1.linux-foundation.org>
Signed-off-by: H. Peter Anvin <8a453bad9912ffe59bc0f0b8abe03df9be19379e@zytor.com>
Cc: Masami Hiramatsu <308c3db2ad395e67f502db11a9ceb1603d4442e0@redhat.com>

--- arch/x86/tools/chkobjdump.awk
+++ arch/x86/tools/chkobjdump.awk
@@ -9,7 +9,7 @@
 }

 /^GNU/ {
-	split($4, ver, ".");
+	split($3, ver, ".");
 	if (ver[1] > od_ver ||
 	    (ver[1] == od_ver && ver[2] >= od_sver)) {
 		exit 1;


Translators/BingTranslator: reuse TempFile in bingTTSUrl, fix #169

--- include/Translators/BingTranslator.awk
+++ include/Translators/BingTranslator.awk
@@ -37,7 +37,7 @@
 function bingTTSUrl(text, tl,
                     ####
                     country, gender, i, group,
-                    header, content, isBody, tempfile) {
+                    header, content, isBody) {
     gender = "female"
     country = NULLSTR
     split(Option["narrator"], group, ",")
@@ -92,9 +92,11 @@
     }
     close(HttpService)

-    tempfile = getOutput("mktemp")
-    printf("%s", content) > tempfile
-    return tempfile
+    if (!TempFile)
+        TempFile = getOutput("mktemp")
+    printf("%s", content) > TempFile
+    close(TempFile)
+    return TempFile
 }

 function bingWebTranslateUrl(uri, sl, tl, hl) {


Translators/GoogleTranslate: preserve alternative translations even if dictionary information exists, fix #188

--- include/Translators/GoogleTranslate.awk
+++ include/Translators/GoogleTranslate.awk
@@ -242,7 +242,7 @@
         if (!hasWordClasses && !hasAltTranslations)
             wShowPromptMessage = wShowLanguages = 0
         if (!hasWordClasses) wShowDictionary = 0
-        if (hasWordClasses || !hasAltTranslations) wShowAlternatives = 0
+        if (!hasAltTranslations) wShowAlternatives = 0

         if (wShowOriginal) {
             # Display: original text & phonetics


display clean-up

display clean-up

--- src/condor_ckpt_server/xfer_log.awk
+++ src/condor_ckpt_server/xfer_log.awk
@@ -73,7 +73,8 @@
 	   "", "Bandwidth", "Success", "Bandwidth", "Success", "Bandwidth",
 	   "Success");
     printf("%-16.16s %9.9s %7.7s %9.9s %7.7s %9.9s %7.7s\n\n",
-	   "User/Host", "(Mb/s)", "Rate", "(Mb/s)", "Rate", "(Mb/s)", "Rate");
+	   "User/Host/Subnet", "(Mb/s)", "Rate", "(Mb/s)", "Rate", "(Mb/s)",
+	   "Rate");
     for (i=0; i < num_users; i++) {
 	User = Users[i];
 	Bytes = BytesSent[User] + BytesRecvd[User];


Translators/BingTranslator: use _sl instead of il

--- include/Translators/BingTranslator.awk
+++ include/Translators/BingTranslator.awk
@@ -259,7 +259,7 @@
         # Transliteration (original)
         wShowOriginalPhonetics = Option["show-original-phonetics"]
         if (wShowOriginalPhonetics) {
-            split(il, group, "-")
+            split(_sl, group, "-")
             content = postResponse(text, group[1], group[1], _hl, "transliterate")
             oPhonetics = unparameterize(content)
             if (oPhonetics == text) oPhonetics = ""
@@ -272,9 +272,9 @@
             # Display: original text & phonetics
             if (r) r = r RS RS
             r = r m("-- display original text")
-            r = r prettify("original", s(text, il))
+            r = r prettify("original", s(text, _sl))
             if (wShowOriginalPhonetics)
-                r = r RS prettify("original-phonetics", showPhonetics(join(oPhonetics, " "), il))
+                r = r RS prettify("original-phonetics", showPhonetics(join(oPhonetics, " "), _sl))
         }

         if (wShowTranslation) {
@@ -295,9 +295,9 @@
             split(temp, group, /(%s|%S|%t|%T)/)
             r = r prettify("languages", group[1])
             if (temp ~ /%s/)
-                r = r prettify("languages-sl", getDisplay(il))
+                r = r prettify("languages-sl", getDisplay(_sl))
             if (temp ~ /%S/)
-                r = r prettify("languages-sl", getName(il))
+                r = r prettify("languages-sl", getName(_sl))
             r = r prettify("languages", group[2])
             if (temp ~ /%t/)
                 r = r prettify("languages-tl", getDisplay(tl))
@@ -309,7 +309,7 @@
         if (wShowDictionary && false) { # FIXME!
             # Dictionary API
             # Note: source language must be identified
-            dicContent = getResponse(text, il, _tl, _hl)
+            dicContent = getResponse(text, _sl, _tl, _hl)
             tokenize(dicTokens, dicContent)
             parseJson(dicAst, dicTokens) # FIXME: inefficient parser


Script now directly invokes sox, and writes batch files instead of
creating a script to do so.

git-svn-id: a8b04003a33e1d3e001b9d20391fa392a9f62d91@1410 94700074-3cef-4d97-a70e-9c8c206c02f5

--- scripts/unbundleHub4.awk
+++ scripts/unbundleHub4.awk
@@ -1,26 +1,26 @@
-# This is an awk script that will take the hub4 eval99 distribution
-# and generate a script that will unpack the distribution into a set
-# of audio and batch files suitable for s4.
+# An awk script that takes the hub4/eval99 data and
+# generates a set of S4 batch files and raw audio
+# to allow a supervised mode of testing
+#
+# Requires 'sox' the sound exchange program to extract the data
+# Change 'directory' as appropriate for your system.
+#
+# Usage:
+#       gawk -f unbundleHub4 *.stm
+#
 #

 BEGIN {
+    directory = "/lab/speech/sphinx4/data/hub4/eval99/supervised/";
+    system("rm -rf " directory );
+    system("mkdir -p " directory);
     audioCount = 0;
-    directory = "/lab/speech/sphinx4/data/hub4/eval99/supervised/";
-
-    print "#!/bin/sh"
-    print "#  This Script unbundles the hub4/eval99 (broadcast news)"
-    print "#  into a set of raw audio and batch files suitable for "
-    print "#  processing by sphinx."
-    print "#  "
-    print "#  This script is automatically generated by unbundleHub99.awk"
-    print "#  "
-    print "#  "
-    print "#  Create the destination directory"
-    print "mkdir -p " directory;
-    print "rm -rf " directory "/*";
-
 }

+
+#
+# Display info about stm file (for debugging purposes)
+#
 function displaySummary() {
     print "========================";
     print "Sphere   : "  sphereName;
@@ -34,19 +34,27 @@
     print "xcrpt    : " transcript;
 }

+
+#
+# Output the batch file, generate the audio file
+#
 function outputCommands() {
-    print "";
-    print "";
-    print "echo Processing" audioName
-    print soxCommand;
-    print "echo " audioName " " transcript " >> " batchName;
-    print "echo " audioName " " transcript " >> " allBatch;
+    printf("%s %s\n", audioName, transcript) >> batchName;
+    printf("%s %s\n", audioName, transcript) >> allBatch;
+    system(soxCommand);
 }

+#
+# Determines if the current utterance is worth keeping
+#
 function isGoodUtterance() {
     return speechClass != "";
 }

+#
+# The main processing loop, extract the pertinent info
+# and excute the commands
+#
 $1 != ";;"  {
     audioCount++;
     source = $1;
@@ -77,7 +85,7 @@

     if (isGoodUtterance()) {
+        displaySummary();
         outputCommands();
     }
-    # displaySummary();
 }


ahrf.awk: remove superfluous curly braces


slight formatting changes in comments

slight formatting changes in comments

--- scripts/process_data.awk
+++ scripts/process_data.awk
@@ -2,7 +2,7 @@
 # ontology types. This script expects the following three files to be
 # passed in, in the following order:
 #
-#   - A list of DBpedia ontology types to select. Any DBpedia resource
+#   * A list of DBpedia ontology types to select. Any DBpedia resource
 #     belonging to at least one of these types according to the
 #     DBpedia "mapping-based types" relations will be selected as a
 #     node in the created graph. Example content:
@@ -13,38 +13,38 @@
 #       <http://dbpedia.org/ontology/Town>
 #       <http://dbpedia.org/ontology/Village>
 #
-#   - A list of "mapping-based types" relations from DBpedia in Turtle
+#   * A list of "mapping-based types" relations from DBpedia in Turtle
 #     ("TTL") format. Example:
 #
 #       http://downloads.dbpedia.org/3.9/en/instance_types_en.ttl.bz2
 #
-#   - A list of "Wikipedia pagelinks" relations from DBpedia in Turtle
+#   * A list of "Wikipedia pagelinks" relations from DBpedia in Turtle
 #     ("TTL") format. Example:
 #
 #       http://downloads.dbpedia.org/3.9/en/page_links_en.ttl.bz2
 #
 # This script will create four files:
 #
-#   - A map from created integer label ids to the provided ontology
+#   * A map from created integer label ids to the provided ontology
 #     types. Written to the file specified by the variable
 #     label_index_file.
 #
-#       Format: [label id] [ontology type name]
+#     Format: [label id] [ontology type name]
 #
-#   - A map from created node ids to the corresponding DBpedia
+#   * A map from created node ids to the corresponding DBpedia
 #     resource names. Written to the file specified by the variable
 #     node_id_index_file.
 #
-#       Format: [node id] [DBpedia resource name]
+#     Format: [node id] [DBpedia resource name]
 #
-#   - A list of integer labels associated with the extracted nodes.
+#   * A list of integer labels associated with the extracted nodes.
 #     The ith line of this file is the label associated with node id
 #     i. Written to the file specified by the variable labels_file.
 #
-#   - A list of edges corresponding to Wikipedia page links between
+#   * A list of edges corresponding to Wikipedia page links between
 #     the extracted nodes. Written to stdout.
 #
-#       Format: [from node id] [to node id]
+#     Format: [from node id] [to node id]
 #
 # Copyright (c) 2013, Roman Garnett (romangarnett@gmail.com)


gen-map: Always use internal version dependency on GLIBC


opcode table parsing fix

opcode table parsing fix

--- opcodes.awk
+++ opcodes.awk
@@ -32,13 +32,13 @@
 		print "opcode" symbols[key] " = opcode(" key ")" | out
 	}
 	print ")" | out
-	print | out
+	print "" | out
 	print "var opcodeStrings = [256]string{" | out
 	for (key in symbols) {
 		print "opcode" symbols[key] ": \"" names[key] "\"," | out
 	}
 	print "}" | out
-	print | out
+	print "" | out
 	print "var opcodeImpls = [256]opImpl{" | out
 	for (i = 1; i <= 256; i++) {
 		key = sprintf("0x%02x", i-1)
@@ -130,7 +130,7 @@
 		print key ": {" gen ", " info "}," comment | out
 	}
 	print "}" | out
-	print | out
+	print "" | out
 	print "var opcodeSkips = [256]func(reader, opcode){" | out
 	for (i = 1; i <= 256; i++) {
 		key = sprintf("0x%02x", i-1)


Fix 0.00 should not pass as int

Fix 0.00 should not pass as int

Fix #4

--- bin/bawlk.awk
+++ bin/bawlk.awk
@@ -117,12 +117,12 @@

         if (type == "integer") {
             cat       = "error"
-            test      = field " && !is_integer(" field ")"
+            test      = field " != \"\" && !is_integer(" field ")"
             mini_msg  = field " should be an integer"
             msg       = "Field " field " in \" CSVFILENAME \" line \" NR \" should be an integer but was \" " field " \" "
         } else if (type == "number") {
             cat       = "error"
-            test      = field " && !is_number(" field ")"
+            test      = field " != \"\" && !is_number(" field ")"
             mini_msg  = field " should be a decimal number"
             msg       = "Field " field " in \" CSVFILENAME \" line \" NR \" should be a decimal number but was \" " field " \" "
         }


[unix][utils] Print language for translation

--- tools/unix/translate.awk
+++ tools/unix/translate.awk
@@ -86,7 +86,7 @@
                 output = gensub(/\\n/, "\n", "g", output)
                 output = gensub(/(\") /, "\\1", "g", output)
                 output = gensub(/ ('|;|:|\.|\,|\!|\?)/, "\\1", "g", output)
-                printf output "\n"
+                printf tl ":" output "\n"
             }
         }
     }


A better Wiktionary processor

A better Wiktionary processor


AWK, this was really bad

AWK, this was really bad


ctx: recognize simple directory name in xterm's wm_name

--- src/ctx.awk
+++ src/ctx.awk
@@ -25,7 +25,8 @@
 	split_file(f, ctx, "ctx.file")
     }
     if(get("ctx.xprop.wm_class_name") == "XTerm" &&
-    match(get("ctx.xprop.wm_name"), /^([^@]*)@([^:]*):(.*)$/, m)) {
+    (match(get("ctx.xprop.wm_name"), /^([^@]*)@([^:]*):(.*)$/, m) ||
+     match(get("ctx.xprop.wm_name"), /^()()(.*)$/, m))) {
 	setCtx("app.exe", "xterm")
 	setCtx("app.user", m[1])
 	setCtx("app.host", m[2])


Update filter_de.awk

Update filter_de.awk

Ordered from top left to bottom right

--- filter_de.awk
+++ filter_de.awk
@@ -139,6 +139,22 @@
                 macroLine = macroLine "+ralt,+rbrace,-rbrace,-ralt";
                 break;
             }
+            if ($x == "ö") {
+                macroLine = macroLine "+colon,-colon";
+                break;
+            }
+            if ($x == "Ö") {
+                macroLine = macroLine "+lshift,+colon,-colon,-lshift";
+                break;
+            }
+            if ($x == "ä") {
+                macroLine = macroLine "+quote,-quote";
+                break;
+            }
+            if ($x == "Ä") {
+                macroLine = macroLine "+lshift,+quote,-quote,-lshift";
+                break;
+            }
             if ($x == "#") {
                 macroLine = macroLine "+hash,-hash";
                 break;
@@ -147,20 +163,28 @@
                 macroLine = macroLine "+lshift,+hash,-hash,-lshift";
                 break;
             }
-            if ($x == "ö") {
-                macroLine = macroLine "+colon,-colon";
-                break;
-            }
-            if ($x == "Ö") {
-                macroLine = macroLine "+lshift,+colon,-colon,-lshift";
-                break;
-            }
-            if ($x == "ä") {
-                macroLine = macroLine "+quote,-quote";
-                break;
-            }
-            if ($x == "Ä") {
-                macroLine = macroLine "+lshift,+quote,-quote,-lshift";
+            if ($x == "<") {
+                macroLine = macroLine "+bslash_iso,-bslash_iso";
+                break;
+            }
+            if ($x == ">") {
+                macroLine = macroLine "+lshift,+bslash_iso,-bslash_iso,-lshift";
+                break;
+            }
+            if ($x == "|") {
+                macroLine = macroLine "+ralt,+bslash_iso,-bslash_iso,-ralt";
+                break;
+            }
+            if ($x == "y") {
+                macroLine = macroLine "+z,-z";
+                break;
+            }
+            if ($x == "Y") {
+                macroLine = macroLine "+lshift,+z,-z,-lshift";
+                break;
+            }
+            if ($x == "µ") {
+                macroLine = macroLine "+ralt,+z,-z,-ralt";
                 break;
             }
             if ($x == ",") {
@@ -169,30 +193,6 @@
             }
             if ($x == ";") {
                 macroLine = macroLine "+lshift,+comma,-comma,-lshift";
-                break;
-            }
-            if ($x == "<") {
-                macroLine = macroLine "+bslash_iso,-bslash_iso";
-                break;
-            }
-            if ($x == ">") {
-                macroLine = macroLine "+lshift,+bslash_iso,-bslash_iso,-lshift";
-                break;
-            }
-            if ($x == "|") {
-                macroLine = macroLine "+ralt,+bslash_iso,-bslash_iso,-ralt";
-                break;
-            }
-            if ($x == "y") {
-                macroLine = macroLine "+z,-z";
-                break;
-            }
-            if ($x == "Y") {
-                macroLine = macroLine "+lshift,+z,-z,-lshift";
-                break;
-            }
-            if ($x == "µ") {
-                macroLine = macroLine "+ralt,+z,-z,-ralt";
                 break;
             }
             if ($x == ".") {


Fix leading space in "Character" credits

--- getBBoxCatalogFromSitemap.awk
+++ getBBoxCatalogFromSitemap.awk
@@ -39,8 +39,10 @@
 /<characterName locale="en-US">/ {
     split ($0,fld,"[<>]")
     char_name = fld[3]
-    # Fix anomalous line with embedded tab ".^I Charlotte Edalji"
-    sub ("^.\t ","",char_name)
+    sub (/^[[:space:]]+/,"",char_name)
+    # Special case
+    # Fix anomalous line with embedded tab ".^I Charlotte Edalji" in "Arthur and George"
+    sub (/^.[[:space:]]+/,"",char_name)
     next
 }
 #


Ignore anything else starting with '#'.

Ignore anything else starting with '#'.

--- src/cloudfront.awk
+++ src/cloudfront.awk
@@ -46,6 +46,10 @@
     numFields = length(fields)
 }

+/^#/ {
+    # ignore anything else starting with "#"
+}
+
 ! /^#/ {
     split($0, fieldsThisLine, " ", sepsThrowAway)
     print "\t{"


addr_utils.awk		-- std -> qry -> OCG -> rply -> std works for all 1622 addresses that have geo!

--- lib/addr_utils.awk
+++ lib/addr_utils.awk
@@ -1,9 +1,10 @@
-function AU_parse(rply, addr, result, towns, st_types, st_quals, dirs,   nf, ary, i, f_st, nf2, ary2, i1, name, street, town) {
+function AU_parse(rply, addr, result, towns, st_types, st_quals, dirs,   nf, ary, i, f_st, nf2, ary2, i1, name, street, quals, town, k) {

 	result["status"] = "B"
 	result["emsg"  ] = ""
 	result["name"  ] = ""
 	result["street"] = ""
+	result["quals" ] = ""
 	result["town"  ] = ""
 	result["state" ] = ""

@@ -71,7 +72,14 @@
 			name = name ", " ary[i]
 	}

-	# TODO: reply addresses need extra thought here
+	# Street qualifiers are those fields, if any, that follow f_st and precede nf
+	if(nf - f_st > 1){
+		quals = ary[f_st+1]
+		for(i = f_st+2; i < nf; i++)
+			quals = quals ", " ary[i]
+	}else
+		quals = ""
+
 	# clean up street
 	nf2 = split(ary[f_st], ary2, /  */)
 	if(nf2 < 2){
@@ -79,23 +87,41 @@
 		return 1
 	}

+	# Street Hacks: Probably should just compare ignore case but not ready for that step yet
+	# change el Camino X to El Camino X
+	# change el Monte X  to El Monte X
+	if(nf2 > 3){
+		if(ary2[nf2-2] == "el" && ary2[nf2-1] == "Camino")
+			ary2[nf2-2] = "El"
+		else if(ary2[nf2-2] == "el" && ary2[nf2-1] == "Monte")
+			ary2[nf2-2] =  "El"
+	}
+
 	# Street should be num [ dir ] str [ st ]
 	street = ary2[1]
-	if(ary2[2] in dirs){
-		street = street " " dirs[ary2[2]]
-		i1 = 3
-	}else
-		i1 = 2
-	for(i = i1; i < nf2; i++){
-		street = street " " ary2[i]
+
+	# This is amusing.  What is South Court? Is is S. Court or South Ct.  No idea so, leave such streets in long form
+	if(nf2 == 3 && (ary2[2] in dirs) && (ary2[3] in st_types)){
+		for(i = 2; i <= nf2; i++)
+			street = street " " ary2[i]
+	}else{
+		if(ary2[2] in dirs){
+			street = street " " dirs[ary2[2]]
+			i1 = 3
+		}else
+			i1 = 2
+		for(i = i1; i < nf2; i++){
+			street = street " " ary2[i]
+		}
+		street = street ((ary2[nf2] in st_types) ? (" " st_types[ary2[nf2]]) : (" " ary2[nf2]))
 	}
-	street = street ((ary2[nf2] in st_types) ? (" " st_types[ary2[nf2]]) : (" " ary2[nf2]))

 	result["status"] = "G"
-	result["name"] = name
+	result["name"  ] = name
 	result["street"] = street
-	result["town"] = town
-	result["state"] = "CA"
+	result["quals" ] = quals
+	result["town"  ] = town
+	result["state" ] = "CA"

 	return 0
 }


Correct double slash in Netflix URLs

Correct double slash in Netflix URLs

--- generateLinksFrom-NetflixActivityPage.awk
+++ generateLinksFrom-NetflixActivityPage.awk
@@ -27,7 +27,7 @@
     split ($0,fld,"\"")
     URL = fld[2]
     gsub (/"/,"",title)
-    printf ("=HYPERLINK(\"https://www.netflix.com/%s\";\"%s\")\t%s\tNetflix Streaming\n",\
+    printf ("=HYPERLINK(\"https://www.netflix.com%s\";\"%s\")\t%s\tNetflix Streaming\n",\
         URL,title,date)
     recordsPrinted += 1
     if (recordsPrinted >= maxRecordsToPrint)


#106097# Correctly parse blocks that do not contain a local: section.

--- solenv/bin/getcsym.awk
+++ solenv/bin/getcsym.awk
@@ -2,9 +2,9 @@
 #
 #   $RCSfile: getcsym.awk,v $
 #
-#   $Revision: 1.2 $
+#   $Revision: 1.3 $
 #
-#   last change: $Author: hjs $ $Date: 2002-11-21 16:50:30 $
+#   last change: $Author: sb $ $Date: 2003-01-10 11:23:14 $
 #
 #   The Contents of this file are made available subject to the terms of
 #   either of the following licenses
@@ -59,11 +59,11 @@
 #
 #
 #*************************************************************************
+
 BEGIN { global_found = "false" }
 /[ \t]*#/ { sub( substr( $0, index($0, "#")),"" ) }
 /[ \t]*local:/ { global_found = "false" }
+/[ \t]*}/ { global_found = "false" }
 /^[ \t]*$/ { next }
 global_found == "true"  { print $0 }
 /[ \t]*global:/ { global_found = "true" }
-
-


Handle missing EntityId

Handle missing EntityId

--- getBBoxCatalogFrom-sitemap.awk
+++ getBBoxCatalogFrom-sitemap.awk
@@ -180,12 +180,6 @@

 # Do any special end of item processing, then print raw data spreadsheet row
 /<\/item>/ {
-    # Add missing EntityId
-    if (title == "Shallow Grave") {
-        EntityId = "_23576"
-        # print "==> EntityId = " EntityId  > "/dev/stderr"
-    }
-
     # "Porridge" needs to be revised to avoid duplicate names
     if (title == "Porridge") {
         if (EntityId == "_9509") {
@@ -236,9 +230,15 @@
         # print "---"  > "/dev/stderr"
     }

-    if (contentId == "p07gnw9f") {
-        EntityId = "_23842"
-        # print "==> EntityId = " EntityId  > "/dev/stderr"
+    if (EntityId == "") {
+        missingIDs += 1
+        printf ("==> Missing EntityId for %s '%s' in show %s\n", contentType, title, showContentId) \
+                >> ERROR_FILE
+        # Add missing EntityId
+        if (contentId == "p07gnw9f") {
+            EntityId = "_23842"
+            # print "==> EntityId = " EntityId  > "/dev/stderr"
+        }
     }

     if (contentType == "movie") {
@@ -278,6 +278,11 @@

 END {
     printf ("In getBBoxCatalogFrom-sitemap.awk\n") > "/dev/stderr"
+    if (missingIDs > 0 ) {
+        missingIDs == 1 ? field = "EntityId" : field = "EntityIds"
+        printf ("    %2d missing %s in %s\n", missingIDs, field, FILENAME) > "/dev/stderr"
+    }
+    #
     if (revisedTitles > 0 ) {
         revisedTitles == 1 ? field = "title" : field = "titles"
         printf ("    %2d %s revised in %s\n", revisedTitles, field, FILENAME) > "/dev/stderr"


add highlight support

add highlight support

--- statistic.awk
+++ statistic.awk
@@ -4,6 +4,7 @@
 	l_points = 0;
 	r_points = 0;
 	game_count = 0;
+	max_sub = 0;
 	win = 0;
 	lost = 0;
 	draw = 0;
@@ -40,7 +41,16 @@
 	l_points += l_point;
 	r_points += r_point;

-	print game_count "\t" l_score ":" r_score "\t" l_point ":" r_point;
+	tmp = max(max_sub, abs(l_score - r_score));
+	if (tmp > max_sub)
+	{
+		max_sub = tmp;
+		print  "\033[01;33m" game_count "\t" l_score ":" r_score "\t" l_point ":" r_point "\033[0m";
+	}
+	else
+	{
+		print game_count "\t" l_score ":" r_score "\t" l_point ":" r_point;
+	}
 }

 END {


See ofmtstrnum fix

See ofmtstrnum fix

--- testdata/gawk/strnum2.awk
+++ testdata/gawk/strnum2.awk
@@ -1,5 +1,5 @@
 BEGIN {
-	split(" 1.234 ", f, "|")	# create a numeric string (strnum) value
+	split(" 1.234 ", f, "x")	# create a numeric string (strnum) value
 	OFMT = "%.1f"
 	CONVFMT = "%.2f"


Languages: add Hmong Daw language

Languages: add Hmong Daw language

--- include/Languages.awk
+++ include/Languages.awk
@@ -1705,6 +1705,15 @@
     Locale["zu"]["iso"]                = "zul"
     Locale["zu"]["glotto"]             = "zulu1248"
     Locale["zu"]["script"]             = "Latn"
+
+    #* Hmong Daw
+    Locale["mww"]["support"]           = "bing-only"
+    Locale["mww"]["name"]              = "Hmong Daw"
+    Locale["mww"]["endonym"]           = "Hmoob Daw"
+    Locale["mww"]["family"]            = "Hmong-Mien"
+    Locale["mww"]["iso"]               = "mww"
+    Locale["mww"]["glotto"]            = "hmon1333"
+    Locale["mww"]["script"]            = "Latn"

     for (i in Locale) {
         # Initialize strings for displaying endonyms of locales


Translate: fix redundant CRLF in postResponse

--- include/Translate.awk
+++ include/Translate.awk
@@ -119,11 +119,11 @@
     if (HttpAuthUser && HttpAuthPass)
         # TODO: digest auth
         header = header "Proxy-Authorization: Basic " HttpAuthCredentials "\r\n"
-    header = header "\r\n" # separate header and body correctly, per RFC 2616

     content = NULLSTR; isBody = 0
     while (1) {
-        print header |& HttpService
+        # separate header and body correctly with CRLF, per RFC 2616
+        print (header "\r\n") |& HttpService
         while ((HttpService |& getline) > 0) {
             if (isBody)
                 content = content ? content "\n" $0 : $0
@@ -190,7 +190,6 @@
     if (HttpAuthUser && HttpAuthPass)
         # TODO: digest auth
         header = header "Proxy-Authorization: Basic " HttpAuthCredentials "\r\n"
-    header = header "\r\n" # separate header and body correctly, per RFC 2616

     content = NULLSTR; isBody = 0
     while (1) {


optimization

optimization

--- bin/util/sameasInNT.awk
+++ bin/util/sameasInNT.awk
@@ -1,9 +1,6 @@
 # sameasFromNT
 #

-$2 == "<http://www.w3.org/2002/07/owl#sameAs>" {
+$2 == "<http://purl.org/dc/terms/isReferencedBy>" || $2 == "<http://www.w3.org/2002/07/owl#sameAs>" {
    print
 }
-$2 == "<http://purl.org/dc/terms/isReferencedBy>" {
-   print
-}


copyright message added

copyright message added

--- english/data_processing/code/coo2dxf.awk
+++ english/data_processing/code/coo2dxf.awk
@@ -1,3 +1,10 @@
+#!/usr/bin/gawk -f
+#
+# create dxf file from space separated coordinate list
+# Zoltan Siki siki.zoltan@epito.bme.hu
+# usage:
+#        gawk -f coo2dxf.awk coodinate_list > dxf_file
+
 BEGIN { FS="[ ]";
     # minimal DXF header
     print "  0";


added phi link

added phi link

--- lib/info.awk
+++ lib/info.awk
@@ -13,8 +13,8 @@
 		{
 		  print "
" $4 "
";
 		  print "
" ;
-		  if (apfam[$3] == "") print "
Family : " substr($3,1,1) tolower(substr($3,2)) "
" ;
-		  else print "
Family : " substr($3,1,1) tolower(substr($3,2)) "
" ;
+		  if (apfam[$3] == "") print "
Family : " substr($3,1,1) tolower(substr($3,2)) "          Φ
" ;
+		  else print "
Family : " substr($3,1,1) tolower(substr($3,2)) "          Φ
" ;
 		  if ($6 != "") print "
Common name : " $6 "
" ;
 		  if ($10 != "") print "
Section : " $10 "
" ;
 		  if ($11 != "") print "
Collection : " $11 "
" ;


Added check for non-interleaving readpairs. Fixed bug with readnames not starting with @

--- extract_barcodes/extract_barcodes.awk
+++ extract_barcodes/extract_barcodes.awk
@@ -17,26 +17,35 @@
     }

 }
-
 {
     if (NR % 8 == 1 && NR > 1) {
-        barcode = substr(read_pair[2], 1, 16);
-        if (attach_in_readname) {
-            initial = barcode"-1_";
+        read_name1 = substr(read_pair[1], 1, match(read_pair[1], / /) - 1)
+        read_name2 = substr(read_pair[5], 1, match(read_pair[5], / /) - 1)
+
+        if (read_name1 != read_name2){
+            print "Read pairs at line " NR " do not interleave correctly: " read_pair[1] "\t" read_pair[5] ;
+        } else {
+            barcode = substr(read_pair[2], 1, 16);
+
+            if (attach_in_readname) {
+                initial = "@"barcode"-1_";
+                read_pair[1] = substr(read_pair[1], 2)
+                read_pair[5] = substr(read_pair[5], 2)
+            }
+
+            if (attach_in_comment) {
+                final = " BX:Z:"barcode"-1";
+            }
+
+            printf initial read_pair[1] final"\n"
+            printf substr(read_pair[2], 17)"\n"
+            printf read_pair[3]"\n"
+            printf substr(read_pair[4], 17)"\n"
+            printf initial read_pair[5] final"\n"
+            printf read_pair[6]"\n"
+            printf read_pair[7]"\n"
+            printf read_pair[0]"\n"
         }
-
-        if (attach_in_comment) {
-            final = " BX:Z:"barcode"-1";
-        }
-
-        printf initial read_pair[1] final"\n"
-        printf substr(read_pair[2], 17)"\n"
-        printf read_pair[3]"\n"
-        printf substr(read_pair[4], 17)"\n"
-        printf initial read_pair[5] final"\n"
-        printf read_pair[6]"\n"
-        printf read_pair[7]"\n"
-        printf read_pair[0]"\n"
     }
     read_pair[NR % 8] = $0
 }


-Added some ignore cases in remove dups awk scripts

git-svn-id: 392d0e5ce652024192c571322d40dcc23d6d83b0@27 8a65f31f-a56f-4bd6-98e8-2755f64920ec

--- awk-scripts/removedups.awk
+++ awk-scripts/removedups.awk
@@ -9,7 +9,8 @@
 	  for (i = seen_count-1; i >= 0; --i) {
 		 file1 = destDir "/frames/Frame" $1 ".html"
 		 file2 = destDir "/frames/Frame" seen[i] ".html"
-		 diff_cmd = sprintf("diff -s --brief -I \"Arrival Time\" -I \"Frame [:digit:]*\" -I \"Resent Packet\" -I \"Suspected resend of frame\" %s %s > /dev/null", file1, file2);
+		 diff_cmd = sprintf("diff -s --brief -I \"Arrival Time\" -I \"Frame [:digit:]*\" -I \"Resent Packet\" -I \"Suspected resend of frame\" -I \"Request Frame: [:digit:]*\" -I \"Response Time (ms): [:digit:]*\" -I \"Release Time (ms): [:digit:]*\" %s %s > /dev/null", file1, file2);
+		 #diff_cmd = sprintf("diff -s --brief -I \"Arrival Time\" -I \"Frame [:digit:]*\" -I \"Resent Packet\" -I \"Suspected resend of frame\" %s %s > /dev/null", file1, file2);
 		 if (system(diff_cmd) == 0) {
 			report_dup = sprintf("echo '%s is identical to %s' 1>&2", file1, file2);
 			system(report_dup);


cfg80211: add function helpers to genregdb.awk

This has no functional change, this just lets us reuse
helpers at a later time.

Signed-off-by: Luis R. Rodriguez <d4fa18192c5a479e564d29c2300c2e15afd1d8d7@do-not-panic.com>
Acked-by: John W. Linville <2a53bac7a5d324865ef46ec4c38b2c0fba1456b4@tuxdriver.com>
Signed-off-by: Johannes Berg <bff32994ff0f8d048f262a8388145a71b6071bfe@intel.com>


Patch from Stefan Allius:

Patch from Stefan Allius:

    Hi Erik,

    I patched the initfini.awk script, so we can build crt[in].S for the SuperH
    targets with gmon-support.

    The patch moves all labels into the wright sections, and add some assembler
    statements to jump over them. (only activ on SH targets)

    The patch also avoid any references of _GLOBAL_OFFSET_TABLE_ or *gmon_start*
    in the crtn.S file. This should work on every target.

    Bye Stefan

--- extra/scripts/initfini.awk
+++ extra/scripts/initfini.awk
@@ -12,7 +12,6 @@
   system("/bin/rm -f crt[in].S");
   omitcrti=0;
   omitcrtn=0;
-  do_sh_specials = 0;
   glb_idx = 0;
   while(getline < "initfini.S")
   { if(/\.endp/) {endp=1}
@@ -20,22 +19,37 @@
     if(/\.align/) {alignval=$2}
 # here comes some special stuff for the SuperH targets
 #  We search for all labels, which uses the _GLOBAL_OFFSET_TABLE_
-#  definition, and store them in the glb_label array.
-    if(/_GLOBAL_OFFSET_TABLE_/) {
-      glb_label[glb_idx] = last;
-      glb_idx += 1;
-      glb = $0;
+#  or a call_gmon_start function reference, and store
+#  them in the glb_label array.
+    if(/_init_EPILOG_BEGINS/) {glb_idx=1;glb_idx_arr[glb_idx]=0}
+    if(/_fini_EPILOG_BEGINS/) {glb_idx=2;glb_idx_arr[glb_idx]=0}
+    if(/EPILOG_ENDS/)         {glb_idx=0}
+    if(/_GLOBAL_OFFSET_TABLE_/||/call_gmon_start/) {
+      glb_label[glb_idx,glb_idx_arr[glb_idx]] = last;
+      glb_idx_arr[glb_idx] += 1;
+      glb_label[glb_idx,glb_idx_arr[glb_idx]] = $0;
+      glb_idx_arr[glb_idx] += 1;
     }
     last = $1;
   }
   close("initfini.S");
 }
 # special rules for the SuperH targets (They do nothing on other targets)
-/SH_GLB_BEGINS/ && glb_idx==0 {omitcrti +=1;do_sh_specials++}
-/_init_SH_GLB/  && glb_idx>=1 {print glb_label[0] glb >> "crti.S"}
-/_fini_SH_GLB/  && glb_idx>=2 {print glb_label[1] glb >> "crti.S"}
-/SH_GLB_ENDS/   && glb_idx==0 {omitcrti -=1}
-/SH_GLB/ || /_GLOBAL_OFFSET_TABLE_/ && do_sh_specials>=1 {getline}
+/SH_GLB_BEGINS/ && glb_idx_arr[1]==0 && glb_idx_arr[2]==0 {omitcrti +=1}
+/_init_SH_GLB/  {glb_idx=1}
+/_fini_SH_GLB/  {glb_idx=2}
+/SH_GLB_ENDS/ {omitcrti -=1}
+/SH_GLB/ \
+{
+  if (glb_idx>0)
+    {
+      for (i=0;i<glb_idx_arr[glb_idx];i+=1) {
+	print glb_label[glb_idx,i] >> "crti.S";
+      }
+      glb_idx = 0;
+    }
+  next;
+}
 # special rules for H8/300 (sorry quick hack)
 /.h8300h/ {end=0}

@@ -54,6 +68,12 @@
 /GMON_STUFF_PAUSES/{omitcrtn=0;getline}
 /GMON_STUFF_UNPAUSES/{omitcrtn=1;getline}
 /GMON_STUFF_ENDS/{omitcrtn=0;getline}
+
+/_GLOBAL_OFFSET_TABLE_/||/gmon_start/ \
+{
+  if(omitcrti==0) {print >> "crti.S";}
+  next;  # no gmon_start or GLOBAL_OFFSET_TABLE references in crtn.S
+}

 /END_INIT/ \
 { if(endp)


adds sensible defaults to bawlk.awk

adds sensible defaults to bawlk.awk

--- bin/bawlk.awk
+++ bin/bawlk.awk
@@ -33,7 +33,7 @@
     print RS
 }

-$1 == "option" {
+$1 == "option" {
     options[$2]=$3;
 }

@@ -53,6 +53,14 @@
 }

 $1 == "field" {
+    defaults["mode"]="append"
+    defaults["summary"]="true"
+    defaults["dcat"]="warning"
+    defaults["dvalnum"]=-9999
+    defaults["dvalstr"]="NA"
+    for (option in defaults) {
+        if (!options[option]) options[option] = defaults[option]
+    }
     rule_type=$2
     split($3,params," ")
     field=params[1]


Add support for designating destdir.

Add support for designating destdir.

--- linkparser/linkparser.awk
+++ linkparser/linkparser.awk
@@ -1,7 +1,5 @@
-#!@include "functions.awk"
-
 BEGIN {
-	version = "0.1.2"
+	version = "0.1.3"
 	printf("link-parser, v%s\n", version)

 	true = 1
@@ -18,7 +16,9 @@
 	NC="\033[0m"
 	BOL="\033[1m"

-	if (arg ~ /test/) {
+	count = 0
+
+	if (arg ~ /ut/) {
 		do_test();
 		SKIP_END = true
 		exit 0
@@ -27,7 +27,15 @@
 	if (arg ~ /pretend/) {
 		pretend = true
 	}
-	count = 0
+
+	if (arg ~ /dest=/) {
+		destdir = gensub(/^.+dest=([^ \t;,]+)/, "\\1", "g", arg)
+		if (system("test -d " destdir) != 0) {
+			print "Directory [" destdir "] doesn't exist!"
+			SKIP_END = true
+			exit 0
+		}
+	}

 	# Skip head lines
 	getline
@@ -41,7 +49,7 @@
 	if (g_sroot == "") {
 		printf("Grabbing sources and headers ...\n")
 		g_sroot = get_sroot(link)
-		"date +%Y%m%d%H-%M%S" | getline date
+		"date +%Y%m%d-%H%M%S" | getline date
 		inst_root = g_sroot"-"date
 	}

@@ -88,27 +96,47 @@
 }

 END {
+	if (SKIP_END)
+		exit 0
 	print "Total dumped files: " count
-	if (pretend)
-		exit 0
-
-	tarball = inst_root ".tar.gz"
-	printf("Generating source tarball %s%s%s%s ...\n", RED, BOL, tarball, NC)
-	system("tar zcf " tarball " " inst_root)
-	system("rm -r "inst_root)
+	if (arg ~ /tar/)
+		make_tarball(arg)
 }

 function rel_install(source, rel_root, new_root) {
 	count++
+	if (pretend)
+		return 0
+
 	dir = dirname(source)
 	base = basename(source)
 	patt = "^.+\\/"rel_root"\\/(sw.+)"
 	rel_path = gensub(patt, "\\1", "g", dir)

-	if (pretend)
-		return 0
+	if (destdir)
+		new_root = destdir "/" new_root
+
 	system("mkdir -p " new_root "/" rel_path)
 	system("cp -L " source " " new_root "/" rel_path)
+}
+
+function make_tarball(flag) {
+	tarball = inst_root ".tar.gz"
+	printf("Generating source tarball %s%s%s%s ...\n", RED, BOL, tarball, NC)
+
+	if (pretend || SKIP_END)
+		exit 0
+
+	"pwd" |getline oldpwd
+	if (destdir)
+		system("cd " destdir)
+
+	system("tar zcf " tarball " " inst_root)
+	if (flag ~ /purge/)
+		system("rm -r "inst_root)
+
+	if (destdir)
+		system("cd " oldpwd)
 }

 function get_sroot(line) {


aux/ematch.awk: better character class support detection in UTF-8 locales

--- lib/modernish/aux/ematch.awk
+++ lib/modernish/aux/ematch.awk
@@ -29,7 +29,7 @@
 BEGIN {
 	if (ARGC != 3)
 		errorout("usage: ematch.awk <string> <ERE>");
-	hasclass = match("1", /[[:alpha:][:digit:]]/);
+	detectclass();
 	exit !match(ARGV[1], convertere(ARGV[2]));
 }

@@ -38,6 +38,31 @@
 	if (ere) printf("%s\n", ere) | "cat >&2";
 	if (i) printf(i>1 ? ("%")(i-1)("c^\n") : "^\n", " ") | "cat >&2";
 	exit 2;
+}
+
+function mylocale() {
+	if ("LC_ALL" in ENVIRON && ENVIRON["LC_ALL"] != "")
+		return ENVIRON["LC_ALL"];
+	else if ("LC_CTYPE" in ENVIRON && ENVIRON["LC_CTYPE"] != "")
+		return ENVIRON["LC_CTYPE"];
+	else if ("LANG" in ENVIRON && ENVIRON["LANG"] != "")
+		return ENVIRON["LANG"];
+	else
+		return "C";
+}
+
+# Detect whether this awk supports character classes properly.
+function detectclass() {
+	# When a UTF-8 locale is active, onetrueawk (before 2019) only matches the first
+	# character class in a bracket expression, even when matching simple ASCII characters.
+	# Ref.: http://gnats.netbsd.org/54424
+	hasclass = match("1", /[[:alpha:][:digit:]]/);
+
+	# Due to a bug in the macOS C library, onetrueawk and mawk (which don't support UTF-8) yield both false positives
+	# and false negatives when matching character classes against high-bit bytes in UTF-8 locales on macOS.
+	# Ref.: https://github.com/onetrueawk/awk/issues/45
+	if (hasclass && match(mylocale(), /[Uu][Tt][Ff]-?8/))
+		hasclass = match("éïÑ", /^[[:alpha:]][[:alpha:]][[:alpha:]]$/);
 }

 # The terms 'branch', 'piece', 'atom' and 'bound' are used as defined


Bugfix: Print also the last element of array after sorting the array.

	modified:   code/awk/generate_source_list_from_make_output.awk

--- code/awk/generate_source_list_from_make_output.awk
+++ code/awk/generate_source_list_from_make_output.awk
@@ -68,14 +68,10 @@
     }
 }
 END{
-    n_dirs = array_index;
     asort(dir_array);

     print "";
     print "include_directories(";

-    for (i = 0; i < n_dirs; i++)
-    {
-        print dir_array[i];
-    }
+    for (i in dir_array) print dir_array[i];
 } # END


minor cleanups

minor cleanups

--- scripts/ntriple2dot.awk
+++ scripts/ntriple2dot.awk
@@ -23,6 +23,7 @@
 	return str
 }

+# if possible, find a shorter form for the input
 function contract(uri){
 	if(uri in prefix)
 		return prefix[uri]
@@ -32,18 +33,17 @@
 			if(0 < start)
 				return exception[substr(uri, start, RLENGTH)]
 		}
-	# else
 		return simplify(uri)
 }

-# get the final (identifier) portion of a slashed path
+# get the final (fragment identifier) portion of a slashed path
 function final(uri){
 	split(trim(uri),b,"/")
 	p = b[length(b)]
 	anchor = match(p, "#")
 	if(anchor > 0)
 		p = substr(p, anchor+1)
-	return
+	return p
 }

 BEGIN{
@@ -90,16 +90,13 @@
 	nodelist[o " [shape=record];"]++
 }

+# output dot file, include edge counts
 END{
 	print "digraph {"
 	print "rankdir=LR;"
 	print "charset=\"utf-8\";"
-	for(edge in edgelist){
-		print edge " (" edgelist[edge] ")\"];"
-	}
-	for(node in nodelist){
-		print node
-	}
+	for(edge in edgelist) print edge " (" edgelist[edge] ")\"];"
+	for(node in nodelist) print node
 	print "}"
 }


oops, this introduced nasty bugs, this one is better, uses more Wordnet data


Tolerate spaces in VMPARAM_vm_disk in libvirt awk script. #6132

Condor_submit no longer removes spaces around the commas in the vm_disk
attribute in the submit file. Update the awk script that the vm-gahp
calls by default to tolerate them.

--- src/condor_vm-gahp/libvirt_simple_script.awk
+++ src/condor_vm-gahp/libvirt_simple_script.awk
@@ -143,7 +143,7 @@
     }

-    n=split(attrs["VMPARAM_vm_Disk"], full_disk, ",");
+    n=split(attrs["VMPARAM_vm_Disk"], full_disk, " *, *");
     for ( i=1; i<=n; i++ )
     {
         # count is used to determine if format is passed.


Update permissions

Update permissions


corrige un peut le output du script de détection des dépendances

--- regexes/generateDependenciesGraph.gawk
+++ regexes/generateDependenciesGraph.gawk
@@ -6,9 +6,12 @@
 function basename(file) {
     sub(".*/", "", file);
     sub(".py","", file);
+    sub("_?((sm)|(SM))","", file);
     return file;
 }
 function writeF(str){
+
+    sub("_?((sm)|(SM))","", str);
     return system("echo \""str"\">>regexes/graphs/dependenceGraph.plantuml")
 }

@@ -29,7 +32,7 @@
     }
     if(match($0, /from .* import (.*)/,arr)&&!match($0, /Behavior/)){
         print "\t",arr[1];
-        writeF(arr[1]" -> "class"\n");
+        writeF(arr[1]" -> "class"");
     }
 }
 END{


fixes summary option not working

fixes summary option not working

--- bin/bawlk.awk
+++ bin/bawlk.awk
@@ -174,6 +174,6 @@
     print "# la fin"
     print "END {"
     print "    if (action == \"insert\") print \"\\\\.\""
-    print "    if (action == \"validate\") print RS \"violation summary: \" RS \"   counts:   \" RS \"      total: \" err_count; print_cats(cats); "
+    print "    if (action == \"validate\" && options[\"summary\"] == \"true\") { print RS \"violation summary: \" RS \"   counts:   \" RS \"      total: \" err_count; print_cats(cats); }"
     print "}"
 }


(/^[0-9A-F]+\.\./): Fix regex for matching.


Removed empty line.

Removed empty line.

--- recipes-core/systemd/systemd-units/candump.awk
+++ recipes-core/systemd/systemd-units/candump.awk
@@ -91,7 +91,6 @@
             else if ("1A" == $8) printf "end of frame\n"
             else if ("12" == $8) printf "intermission\n"
             printf("%u) %.3f 1 Error %s - 4 00 %s 00 00", NR, currentTimeOffset * 1000, type, position)
-
         }
         else if ("20000010" == $3)
         {


Pretty formatting for repport

Pretty formatting for repport

--- count.awk
+++ count.awk
@@ -19,6 +19,6 @@
   exec = getTime() - start;
   for(i in r)
   {
-    print r[i]"\t"(r[i]/exec)"\t"i
+    printf("%d\t%.2f\t%s\n", r[i], r[i]/exec, i)
   }
 }


raw params need foaf and dct for provenance

--- bin/util/header2params2.awk
+++ bin/util/header2params2.awk
@@ -40,18 +40,18 @@
    }
    print "@prefix xsd:        <http://www.w3.org/2001/XMLSchema#> ."
    if(length(conversionID)) {
-      print "@prefix dcterms:    <http://purl.org/dc/terms/> ."
       print "@prefix vann:       <http://purl.org/vocab/vann/> ."
       print "@prefix skos:       <http://www.w3.org/2004/02/skos/core#> ."
-      print "@prefix foaf:       <http://xmlns.com/foaf/0.1/> ."
       print "@prefix time:       <http://www.w3.org/2006/time#> ."
       print "@prefix wgs:        <http://www.w3.org/2003/01/geo/wgs84_pos#> ."
       print "@prefix geonames:   <http://www.geonames.org/ontology#> ."
       print "@prefix con:        <http://www.w3.org/2000/10/swap/pim/contact#> ."
    }
+   print "@prefix dcterms:    <http://purl.org/dc/terms/> ."
    print "@prefix void:       <http://rdfs.org/ns/void#> ."
    print "@prefix scovo:      <http://purl.org/NET/scovo#> ."
    print "@prefix sioc:       <http://rdfs.org/sioc/ns#> ."
+   print "@prefix foaf:       <http://xmlns.com/foaf/0.1/> ."
    #if(showConversionProcess>0) {
       print "@prefix ov:         <http://open.vocab.org/terms/> ."
    #}


Improved pivot_by_region.awk to not render duplicated regional identifiers

--- files/awsm-cli/internal/pivot_by_region.awk
+++ files/awsm-cli/internal/pivot_by_region.awk
@@ -27,9 +27,10 @@
         if (aws_resource_type ~ /^(aki|ami|ari|eipalloc|elb|subnet|i|vpc)$/) {
           aws_resource_identifier = $i
           if (length(results[region, aws_resource_type]) == 0)
-            results[region, aws_resource_type] = results[region, aws_resource_type] aws_resource_identifier
+            results[region, aws_resource_type] = aws_resource_identifier
           else
-            results[region, aws_resource_type] = results[region, aws_resource_type] " " aws_resource_identifier
+            if (index(results[region, aws_resource_type], aws_resource_identifier) == 0)
+              results[region, aws_resource_type] = results[region, aws_resource_type] " " aws_resource_identifier
         }
       }
     }


added todo

added todo

--- bin/util/header2params2.awk
+++ bin/util/header2params2.awk
@@ -169,9 +169,9 @@
    #
    if( cellDelimiter != "\t" ) {
                                     printf("      conversion:delimits_cell \"%s\";\n",cellDelimiter);
-                                    printf("      #conversion:delimits_cell \"	\"; # tab\n");
+                                    printf("      #conversion:delimits_cell \"	\"; # tab\n"); # TODO: Jena likes "\u0009" better.
    }else {
-                                    printf("      conversion:delimits_cell \"	\"; # tab\n");
+                                    printf("      conversion:delimits_cell \"	\"; # tab\n"); # TODO: Jena likes "\u0009" better.
    }
                                     printf("      #conversion:delimits_cell \"|\";   # pipe\n");
                                     printf("      #conversion:delimits_cell \",\";   # comma\n");


bin/util/header2params2.awk accepts new param for cellDelimiter

--- bin/util/header2params2.awk
+++ bin/util/header2params2.awk
@@ -12,6 +12,7 @@
 # -v subjectDiscriminator
 # -v conversionID
 #
+# -v cellDelimiter
 # -v header
 # -v dataStart
 # -v dataEnd
@@ -30,6 +31,11 @@
    #FS=","
    STEP = length(conversionID) ? sprintf("enhancement/%s",conversionID) : "raw";
    TYPE = length(conversionID) ? "Enhancement" : "Raw";
+   # TODO: '|' has no length? --\/
+          DELIMTER  = length(cellDelimiter) ? cellDelimiter : "	" # <--- that's a tab character.
+   commentDELIMITER = length(cellDelimiter) ? ""            : "#";
+   #print "#AWK: cellDelimiter:",cellDelimiter," DELIMITER: ",DELIMITER," comment: ",commentDELIMITER
+
    if(length(showConversionProcess)) {
       print "@prefix rdf:        <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ."
       print "@prefix rdfs:       <http://www.w3.org/2000/01/rdf-schema#> ."
@@ -128,6 +134,11 @@
    #
    # Structural enhancement parameters.
    #
+                                    printf("      conversion:delimits_cell \"%s\";\n",cellDelimiter);
+                                    printf("      #conversion:delimits_cell \"	\"; # tab\n");
+                                    printf("      #conversion:delimits_cell \"|\";   # pipe\n");
+                                    printf("      #conversion:delimits_cell \",\";   # comma\n");
+                                    print
    if(length(header)) {
                                     # Include header info even if just raw.
                                     printf("      conversion:enhance [      \n");


Don't modify episodeNumber for trailers

Don't modify episodeNumber for trailers

--- getMHzFrom-episodePages.awk
+++ getMHzFrom-episodePages.awk
@@ -109,11 +109,6 @@
     sub (/.*Episode /,"")
     sub (/<\/span>.*/,"")
     episodeNumber = $0 + 0
-    if (episodeType == "T") {
-        printf ("==> Corrected %s%02d to T01: %s\n", episodeType, episodeNumber, \
-                shortURL) >> ERROR_FILE
-        episodeNumber = 1
-    }
     if ((episodeURL ~ /-c-.[[:digit:]]{3,4}$/) && episodeNumber != episodeNumberFromURL) {
         printf ("==> Corrected %s%02d to %s%02d: %s\n", episodeType, episodeNumber, episodeType, \
                 episodeNumberFromURL, shortURL) >> ERROR_FILE


Help: update

Help: update

--- include/Help.awk
+++ include/Help.awk
@@ -26,7 +26,7 @@
         sprintf("%-22s%s\n", "terminal type", ENVIRON["TERM"])          \
         sprintf("%-22s%s (%s)\n", "user locale", UserLocale, getName(UserLang)) \
         sprintf("%-22s%s\n", "home language", Option["hl"])             \
-        sprintf("%-22s%s\n", "source language", Option["sl"])           \
+        sprintf("%-22s%s\n", "source language", join(Option["sls"], "+")) \
         sprintf("%-22s%s\n", "target language", join(Option["tl"], "+")) \
         sprintf("%-22s%s\n", "translation engine", Option["engine"])    \
         sprintf("%-22s%s\n", "proxy", Option["proxy"] ? Option["proxy"] :
@@ -42,7 +42,7 @@
 function getHelp() {
     return "Usage:  " ansi("bold", Command)                             \
         " [" ansi("underline", "OPTIONS") "]"                           \
-        " [" ansi("underline", "SOURCE") "]"                            \
+        " [" ansi("underline", "SOURCES") "]"                           \
         ":[" ansi("underline", "TARGETS") "]"                           \
         " [" ansi("underline", "TEXT") "]..." RS                        \
         RS "Information options:" RS                                    \
@@ -166,13 +166,13 @@
             ", " ansi("bold", "-hl ") ansi("underline", "CODE")         \
             ", " ansi("bold", "-lang ") ansi("underline", "CODE")) RS   \
         ins(2, "Specify your home language.") RS                        \
-        ins(1, ansi("bold", "-s ") ansi("underline", "CODE")            \
-            ", " ansi("bold", "-sl ") ansi("underline", "CODE")         \
-            ", " ansi("bold", "-source ") ansi("underline", "CODE")     \
-            ", " ansi("bold", "-from ") ansi("underline", "CODE")) RS   \
-        ins(2, "Specify the source language.") RS                       \
+        ins(1, ansi("bold", "-s ") ansi("underline", "CODES")           \
+            ", " ansi("bold", "-sl ") ansi("underline", "CODES")        \
+            ", " ansi("bold", "-source ") ansi("underline", "CODES")    \
+            ", " ansi("bold", "-from ") ansi("underline", "CODES")) RS  \
+        ins(2, "Specify the source language(s), joined by '+'.") RS     \
         ins(1, ansi("bold", "-t ") ansi("underline", "CODES")           \
-            ", " ansi("bold", "-tl ") ansi("underline", "CODE")         \
+            ", " ansi("bold", "-tl ") ansi("underline", "CODES")        \
             ", " ansi("bold", "-target ") ansi("underline", "CODES")    \
             ", " ansi("bold", "-to ") ansi("underline", "CODES")) RS    \
         ins(2, "Specify the target language(s), joined by '+'.") RS     \


Main: support shortcut option /ENGINE

Main: support shortcut option /ENGINE

--- include/Main.awk
+++ include/Main.awk
@@ -234,12 +234,20 @@

         ## Translator options

-        # -e, -engine
+        # -e ENGINE, -engine ENGINE
         match(ARGV[pos], /^--?(e|engine)(=(.*)?)?$/, group)
         if (RSTART) {
             Option["engine"] = group[2] ?
                 (group[3] ? group[3] : Option["engine"]) :
                 ARGV[++pos]
+            continue
+        }
+
+        # Shortcut format
+        # '/ENGINE'
+        match(ARGV[pos], /^\/(.*)$/, group)
+        if (RSTART) {
+            Option["engine"] = group[1]
             continue
         }


Translators/DeepLTranslator: utilize LMT_split_into_sentences, fix #249

--- include/Translators/DeepLTranslator.awk
+++ include/Translators/DeepLTranslator.awk
@@ -23,13 +23,29 @@
     # Not implemented
 }

-# Send an HTTP POST request and get response from DeepL Translator (via curl).
-function deeplPost(text, sl, tl, hl,
+# Send an HTTP POST request and get response from DeepL Translator (via curl) for splitting into sentences.
+function deeplPostSplit(text, sl, tl, hl,
                    ####
                    content, data, url) {
+    data = "{\"jsonrpc\":\"2.0\",\"method\":\"LMT_split_into_sentences\","
+    data = data "\"params\":{\"texts\":[" parameterize(text, "\"") "]}}"
+    l(data)
+    url = "https://www2.deepl.com/jsonrpc"
+    content = curlPost(url, data)
+    return assert(content, "[ERROR] Null response.")
+}
+
+# Send an HTTP POST request and get response from DeepL Translator (via curl).
+function deeplPost(sentences, sl, tl, hl,
+                   ####
+                   content, data, i, url) {
     data = "{\"jsonrpc\":\"2.0\",\"method\":\"LMT_handle_jobs\","
-    data = data "\"params\":{\"jobs\":[{\"kind\":\"default\","
-    data = data "\"raw_en_sentence\":" parameterize(text, "\"") "}],"
+    data = data "\"params\":{\"jobs\":["
+    for (i in sentences) {
+        if (i > 0) data = data ","
+        data = data "{\"kind\":\"default\",\"raw_en_sentence\":" parameterize(sentences[i], "\"") "}"
+    }
+    data = data "],"
     data = data "\"lang\":{\"user_preferred_langs\":[\"" hl "\"],"
     data = data "\"source_lang_user_selected\":\"" sl "\","
     data = data "\"target_lang\":\"" tl "\"},"
@@ -44,10 +60,10 @@
 function deeplTranslate(text, sl, tl, hl,
                         isVerbose, toSpeech, returnPlaylist, returnIl,
                         ####
-                        r,
+                        r, i, j,
                         content, tokens, ast,
                         _sl, _tl, _hl, il,
-                        translation, translations,
+                        sentences, translation, translations,
                         wShowOriginal, wShowTranslation,
                         wShowLanguages, wShowAlternatives,
                         group, temp) {
@@ -68,7 +84,15 @@
     if (_tl != "auto") _tl = toupper(_tl)
     if (_hl != "auto") _hl = toupper(_hl)

-    content = deeplPost(text, _sl, _tl, _hl)
+    content = deeplPostSplit(text, _sl, _tl, _hl)
+    tokenize(tokens, content)
+    parseJson(ast, tokens)
+    for (i in ast) {
+        if (i ~ "^0" SUBSEP "result" SUBSEP "splitted_texts" SUBSEP "[[:digit:]]+" SUBSEP "[[:digit:]]+") {
+            append(sentences, uprintf(unquote(unparameterize(ast[i]))))
+        }
+    }
+    content = deeplPost(sentences, _sl, _tl, _hl)
     if (Option["dump"])
         return content
     tokenize(tokens, content)
@@ -85,15 +109,22 @@

     saveSortedIn = PROCINFO["sorted_in"]
     PROCINFO["sorted_in"] = "compareByIndexFields"
+    j = 0
     for (i in ast) {
-        if (i ~ "^0" SUBSEP "result" SUBSEP "translations" SUBSEP 0 SUBSEP "beams" SUBSEP "[[:digit:]]+" SUBSEP "postprocessed_sentence$") {
+        if (i ~ "^0" SUBSEP "result" SUBSEP "translations" SUBSEP "[[:digit:]]+" SUBSEP "beams" \
+            SUBSEP "[[:digit:]]+" SUBSEP "postprocessed_sentence$") {
             # FIXME: build a cache for recurring invocation of uprintf()
-            append(translations, uprintf(unquote(unparameterize(ast[i]))))
+            temp = uprintf(unquote(unparameterize(ast[i])))
+            append(translations, temp)
+        }
+        if (i ~ "^0" SUBSEP "result" SUBSEP "translations" SUBSEP j SUBSEP "beams" \
+            SUBSEP "[[:digit:]]+" SUBSEP "postprocessed_sentence$") {
+            translation = j > 0 ? translation " " temp : temp
+            j++
         }
     }
     PROCINFO["sorted_in"] = saveSortedIn

-    translation = translations[0]
     returnIl[0] = il = tolower(unparameterize(ast[0 SUBSEP "result" SUBSEP "source_lang"]))
     if (Option["verbose"] < -1)
         return il


Commons: handle Unicode '<' and '>' correctly, fix #139

--- include/Commons.awk
+++ include/Commons.awk
@@ -170,6 +170,10 @@
         return "\v" # Vertical Tab
     case "u0026":
         return "&" # Unicode Character 'AMPERSAND'
+    case "u003c":
+        return "<" # Unicode Character 'LESS-THAN SIGN'
+    case "u003e":
+        return ">" # Unicode Character 'GREATER-THAN SIGN'
     default:
         return char
     }


monitorKeyFrames

monitorKeyFrames

--- packager/bin/monitorKeyFrames.awk
+++ packager/bin/monitorKeyFrames.awk
@@ -28,9 +28,9 @@
         max[segIdx]=segTime
     }
     if(flavorCnt > 0 && callCnt == 10*flavorCnt ){
-        for(seg in max){
-           print "INFO: segIdx="seg" diff  "max[seg]-min[seg]
-        }
+       # for(seg in max){
+        #   print "INFO: segIdx="seg" diff  "max[seg]-min[seg]
+        #}
         delete max
         delete min
         callCnt = 0


added dbpedia owl and prop to defaults

added dbpedia owl and prop to defaults

--- bin/util/header2params2.awk
+++ bin/util/header2params2.awk
@@ -56,6 +56,8 @@
       print "@prefix geonamesid:    <http://sws.geonames.org/> ."
       print "@prefix govtrackusgov: <http://www.rdfabout.com/rdf/usgov/geo/us/> ."
       print "@prefix dbpedia:       <http://dbpedia.org/resource/> ."
+      print "@prefix dbpediaprop:   <http://dbpedia.org/property/> ."
+      print "@prefix dbpediaowl:    <http://dbpedia.org/ontology/> ."
       print "@prefix con:           <http://www.w3.org/2000/10/swap/pim/contact#> ."
       print "@prefix muo:           <http://purl.oclc.org/NET/muo/muo#> ."
       print "@prefix vs:            <http://www.w3.org/2003/06/sw-vocab-status/ns#> ."


Synsets with 10K words are trash

Synsets with 10K words are trash

--- impl/delabel.awk
+++ impl/delabel.awk
@@ -4,12 +4,20 @@
 }
 {
     gsub("(#[[:digit:]]+|, $)", "");
-    for (i = 1; i <= split($3, words, ", "); i++) uniq[words[i]];
+
+    len = split($3, words, ", ");
+
+    if (len >= 10000) next;
+
+    for (i = 1; i <= len; i++) uniq[words[i]];
+
     for (word in uniq) {
         synset = synset sep word;
         sep = ", ";
         len++;
     }
+
     print $1, len, synset | "sort --parallel=$(nproc) -t \"\t\" -S1G -k2nr -k1n -s";
+
     synset = sep = len = ""; delete uniq;
 }


fix missing episode number in mammon/season:1/videos/the-murder

--- getMHzFrom-episodePages.awk
+++ getMHzFrom-episodePages.awk
@@ -85,6 +85,9 @@
     if (episodeURL ~ /-c-[[:digit:]]{5}$/)
         episodeNumberFromURL = substr (episodeURL, length(episodeURL)-1, 2)
     episodeTitle = fld[4]
+    # kludge for missing episode number in mammon/season:1/videos/the-murder
+    if (episodeTitle ~ /Sn 1 Ep 5/)
+        episodeNumberFromURL = "05"
     gsub (/"/,"\"\"",episodeTitle)
     sub (/.*season:/,"")
     sub (/\/.*/,"")


added qb prefix

added qb prefix

--- bin/util/header2params2.awk
+++ bin/util/header2params2.awk
@@ -62,6 +62,7 @@
       print "@prefix frbr:          <http://purl.org/vocab/frbr/core#> ."
       print "@prefix bibo:          <http://purl.org/ontology/bibo/> ."
       print "@prefix doap:          <http://usefulinc.com/ns/doap#> ."
+      print "@prefix qb:            <http://purl.org/linked-data/cube#> ."
       print "@prefix dgtwc:         <http://data-gov.tw.rpi.edu/2009/data-gov-twc.rdf#> ."
    }
    print "@prefix dcterms:       <http://purl.org/dc/terms/> ."


Typo.

Typo.

git-svn-id: 293778eaa97c8c94097d610b1bd5133a8f478f36@30388 4f837ed2-42f5-46e7-a7a5-fa17313484d4

--- scripts/tdb/statuses_gln.awk
+++ scripts/tdb/statuses_gln.awk
@@ -32,7 +32,7 @@
       if (r[pn] == "") {
         if ((substr(p[pn],1,2) <= "American H")) {
           r[pn] = "5"
-        } else if ((substr(p[pn],1,2) >= "AMerican I") && (substr(p[pn],1,2) <= "Bz")) {
+        } else if ((substr(p[pn],1,2) >= "American I") && (substr(p[pn],1,2) <= "Bz")) {
           r[pn] = "4"
         } else if ((substr(p[pn],1,2) >= "CA") && (substr(p[pn],1,2) <= "Nz")) {
           r[pn] = "5"


Update filter_en_uk.awk

Update filter_en_uk.awk

Ordered keys from top left to bottom right

--- filter_en_uk.awk
+++ filter_en_uk.awk
@@ -99,14 +99,6 @@
                 macroLine = macroLine "+lshift,+rbrace,-rbrace,-lshift";
                 break;
             }
-            if ($x == "#") {
-                macroLine = macroLine "+hash,-hash";
-                break;
-            }
-            if ($x == "~") {
-                macroLine = macroLine "+lshift,+hash,-hash,-lshift";
-                break;
-            }
             if ($x == ";") {
                 macroLine = macroLine "+colon,-colon";
                 break;
@@ -123,8 +115,12 @@
                 macroLine = macroLine "+lshift,+quote,-quote,-lshift";
                 break;
             }
-            if ($x == ",") {
-                macroLine = macroLine "+comma,-comma";
+            if ($x == "#") {
+                macroLine = macroLine "+hash,-hash";
+                break;
+            }
+            if ($x == "~") {
+                macroLine = macroLine "+lshift,+hash,-hash,-lshift";
                 break;
             }
             if ($x == "\\") {
@@ -133,6 +129,10 @@
             }
             if ($x == "|") {
                 macroLine = macroLine "+lshift,+bslash_iso,-bslash_iso,-lshift";
+                break;
+            }
+            if ($x == ",") {
+                macroLine = macroLine "+comma,-comma";
                 break;
             }
             if ($x == "<") {


Help: update getHelp()

Help: update getHelp()

--- include/Help.awk
+++ include/Help.awk
@@ -75,6 +75,27 @@

 # Return help message as a string.
 function getHelp() {
-    return "Usage: translate [options] [source]:[target] [<text>] ...\n" \
-        "       translate [options] [source]:[target1]+[target2]+... [<text>] ...\n"
+    return "Usage: " Command " [options] [source]:[target] [" AnsiCode["underline"] "text" AnsiCode["no underline"] "] ...\n" \
+        "       " Command " [options] [source]:[target1]+[target2]+... [" AnsiCode["underline"] "text" AnsiCode["no underline"] "] ...\n\n" \
+        "Options:\n" \
+        "  " AnsiCode["bold"] "-V, -version" AnsiCode["no bold"] "\n    Print version and exit.\n" \
+        "  " AnsiCode["bold"] "-H, -h, -help" AnsiCode["no bold"] "\n    Show this manual, or print this help message and exit.\n" \
+        "  " AnsiCode["bold"] "-r, -reference" AnsiCode["no bold"] "\n    Print a list of languages (displayed in endonyms) and their ISO 639 codes for reference, and exit.\n" \
+        "  " AnsiCode["bold"] "-R, -reference-english" AnsiCode["no bold"] "\n    Print a list of languages (displayed in English names) and their ISO 639 codes for reference, and exit.\n" \
+        "  " AnsiCode["bold"] "-v, -verbose" AnsiCode["no bold"] "\n    Verbose mode. (default)\n" \
+        "  " AnsiCode["bold"] "-b, -brief" AnsiCode["no bold"] "\n    Brief mode.\n" \
+        "  " AnsiCode["bold"] "-w [num], -width [num]" AnsiCode["no bold"] "\n    Specify the screen width for padding when displaying right-to-left languages.\n" \
+        "  " AnsiCode["bold"] "-p, -play" AnsiCode["no bold"] "\n    Listen to the translation.\n" \
+        "  " AnsiCode["bold"] "-P [program], -player [program]" AnsiCode["no bold"] "\n    Specify the command-line audio player to use, and listen to the translation.\n" \
+        "  " AnsiCode["bold"] "-I, -interactive" AnsiCode["no bold"] "\n    Start an interactive shell, invoking `rlwrap` whenever possible (unless `-no-rlwrap` is specified).\n" \
+        "  " AnsiCode["bold"] "-no-rlwrap" AnsiCode["no bold"] "\n    Don't invoke `rlwrap` when starting an interactive shell with `-I`.\n" \
+        "  " AnsiCode["bold"] "-E, -emacs" AnsiCode["no bold"] "\n    Start an interactive shell within GNU Emacs, invoking `emacs`.\n" \
+        "  " AnsiCode["bold"] "-prompt [prompt_string]" AnsiCode["no bold"] "\n    Customize your prompt string in the interactive shell.\n" \
+        "  " AnsiCode["bold"] "-prompt-color [color_code]" AnsiCode["no bold"] "\n    Customize your prompt color in the interactive shell.\n" \
+        "  " AnsiCode["bold"] "-i [file], -input [file]" AnsiCode["no bold"] "\n    Specify the input file name.\n" \
+        "  " AnsiCode["bold"] "-o [file], -output [file]" AnsiCode["no bold"] "\n    Specify the output file name.\n" \
+        "  " AnsiCode["bold"] "-l [code], -lang [code]" AnsiCode["no bold"] "\n    Specify your own, native language (\"home/host language\").\n" \
+        "  " AnsiCode["bold"] "-s [code], -source [code]" AnsiCode["no bold"] "\n    Specify the source language (language of the original text).\n" \
+        "  " AnsiCode["bold"] "-t [codes], -target [codes]" AnsiCode["no bold"] "\n    Specify the target language(s) (language(s) of the translated text).\n" \
+        "\nSee the man page " Command "(1) for more information."
 }


var/mapr.awk: END: fix ORS logic (re: 2414bb8f)

--- libexec/modernish/var/mapr.awk
+++ libexec/modernish/var/mapr.awk
@@ -114,12 +114,11 @@

 END {
 	if (NR) {
-		ORS = "\n";
 		printsh("||_Msh_mapr_ckE \"$@\"||break");
 		if (cont) {
-			print ("_Msh_M_NR=") (NR+1);
+			print ("\n_Msh_M_NR=") (NR+1) ("\n");
 		} else {
-			print "_Msh_M_NR=RET0";
+			print ("\n_Msh_M_NR=RET0") ("\n");
 		}
 	}
 }


Display plurals correctly in testsuite summary

David R Allsopp -- pedantically eschewing lazy plural(s) since 1994.

--- testsuite/makefiles/summarize.awk
+++ testsuite/makefiles/summarize.awk
@@ -142,13 +142,13 @@
             }
             printf("\n");
             printf("Summary:\n");
-            printf("  %3d test(s) passed\n", passed);
-            printf("  %3d test(s) skipped\n", skipped);
-            printf("  %3d test(s) failed\n", failed);
-            printf("  %3d unexpected error(s)\n", unexped);
+            printf("  %3d test%s passed\n", passed, (passed == 1 ? "" : "s"));
+            printf("  %3d test%s skipped\n", skipped, (skipped == 1 ? "" : "s"));
+            printf("  %3d test%s failed\n", failed, (failed == 1 ? "" : "s"));
+            printf("  %3d unexpected error%s\n", unexped, (unexped == 1 ? "" : "s"));
             printf("  %3d tests considered%s\n", length(RESULTS), (length(RESULTS) != passed + skipped + failed + unexped ? " (totals don't add up??)": ""));
             if (reran != 0){
-                printf("  %3d test dir re-run(s)\n", reran);
+                printf("  %3d test dir re-run%s\n", reran, (reran == 1 ? "" : "s"));
             }
             if (failed != 0){
                 printf("\nList of failed tests:\n");
@@ -164,7 +164,7 @@
             }
             printf("\n");
             if (failed || unexped){
-                printf("#### Some tests failed. Exiting with error status.\n\n");
+                printf("#### Something failed. Exiting with error status.\n\n");
                 exit 4;
             }
         }else{


r9836/sofa-dev : FIX: trying to better flag files that are in SOFA_DEV but commented in the .pro

--- scripts/filter-qmake-pro.awk
+++ scripts/filter-qmake-pro.awk
@@ -62,13 +62,19 @@
 	    infilelist=1;
 	    f0=3; # first file is in 3rd field
 	}
+	else if ($1~"###") {
+	    #print "#infilelist " $1
+	    infilelist=1;
+	    f0=2; # first file is in 3rd field
+	}
     }
     if (infilelist) {
 	for(f=f0;f<=nf && !(f==nf && $f~/^[:space:]*\\[:space:]*$/);f++) {
 	    fname=$f
 	    gsub(/[\r\n]/,"",fname);
 	    gsub(/\\[:space:]*$/,"",fname);
-	    if (fname != "#") print fname > "/dev/stderr";
+	    gsub(/^##*/,"",fname);
+	    if (fname != "") print fname > "/dev/stderr";
 	}
 	if (f>nf && (nf==0 || $nf!~/\\[:space:]*$/)) { # no "\\" is put at the end of the line -> end of list
 	    #print "#end"


Fix some special cases

Fix some special cases

-c-, Brotherhood of Blood Murder

--- getMHzFromSitemap.awk
+++ getMHzFromSitemap.awk
@@ -227,21 +227,26 @@
         # print shortEpisodeURL " pr " prEpisodeNumber >"/dev/stderr"
     }
     # If episode is a upcoming, i.e. - EP 507" Available... use its episode number
-        if (match (episodeTitle, /-[[:space:]]{1,2}EP [[:digit:]]{3,4}\"/)) {
-            snEpisodeNumber = substr(episodeTitle, RSTART+RLENGTH-3, 2)
+        if (match (episodeTitle, /-[[:space:]]{1,2}EP [[:digit:]]{3,4}/)) {
+            snEpisodeNumber = substr(episodeTitle, RSTART+RLENGTH-2, 2)
         # print shortEpisodeURL " pr " prEpisodeNumber >"/dev/stderr"
     }
     # print "==> episodeType = " episodeType > "/dev/stderr"
     #
     # Season and episode numbers
     #
-    # Special episode number cases...
+    # Special case episode numbers
     # Montalbano episodes have no season, make them season 1
     if (episodeTitle ~ /^Montalbano|^Detective Montalbano:/) {
         sub (/\(Ep/,"(Sn 1 Ep",episodeTitle)
         sub (/^Montalbano:/,"Detective Montalbano:",episodeTitle)
         sub (/^Montalbano and Me/,"Detective Montalbano: Montalbano and Me",episodeTitle)
     }
+    # Baantjer Sn 1 Ep 12 is missing a parens
+    sub (/Brotherhood of Blood Murder Sn/, "Brotherhood of Blood Murder (Sn",episodeTitle)
+    # A Night in ... is missing episode numbers
+    if (shortEpisodeURL ~ /season:1\/videos\/a-night-in/)
+        snEpisodeNumber = 1

     # Grab the Episode Number from the trailing (Sn 1 Ep 1)
     # Episode Number(s)
@@ -251,6 +256,14 @@
         sub (/.*[[:space:]]/,"",snEpisodeNumber)
         sub (/\).*/,"",snEpisodeNumber)
         # print shortEpisodeURL " sn " snEpisodeNumber >"/dev/stderr"
+    }
+
+    # Octopus and some others uses -c-0
+    if (match (shortEpisodeURL, /-c-[[:digit:]]{5}/)) {
+        if (snEpisodeNumber == "" && prEpisodeNumber == "") {
+            cxEpisodeNumber = substr(shortEpisodeURL, RSTART+RLENGTH-3, 3)
+            # print shortEpisodeURL " c- " snEpisodeNumber >"/dev/stderr"
+         }
     }

     # print "==> episodeTitle = " episodeTitle > "/dev/stderr"
@@ -309,16 +322,18 @@
         #
         # Check for valid seasonNumber and episodeNumber before using them
         if (seasonNumber == "")
-            printf ("==> Missing seasonNumber in \"%s: %s\"\n", showTitle, episodeTitle) >> ERRORS
+            printf ("==> Missing seasonNumber in \"%s: %s\" %s\n", showTitle,
+                    episodeTitle, shortEpisodeURL) >> ERRORS
         #
         episodeNumber = snEpisodeNumber
-        if (cxEpisodeNumber != "")
+        if (cxEpisodeNumber != "")
             episodeNumber = cxEpisodeNumber
-        if (prEpisodeNumber != "" && cxEpisodeNumber == "")
+        if (prEpisodeNumber != "" && cxEpisodeNumber == "")
             episodeNumber = prEpisodeNumber
         #
         if (episodeNumber == "")
-            printf ("==> Missing episodeNumber in \"%s: %s\"\n", showTitle, episodeTitle) >> ERRORS
+            printf ("==> Missing episodeNumber in \"%s: %s\" %s\n", showTitle,
+                    episodeTitle, shortEpisodeURL) >> ERRORS
         #
         episodeLink = sprintf ("=HYPERLINK(\"%s\";\"%s, S%02d%s%02d, %s\")", episodeURL, showTitle,
                     seasonNumber, episodeType, episodeNumber, episodeTitle)
@@ -350,7 +365,7 @@
             sub (/ [0-9][0-9][0-9][0-9]\./,"",director_name)
             sub (/[[:space:]]+$/,"",director_name)
             sub (/\.$/,"",director_name)
-            # Special cases
+            # Special case director names
             if (director_name ~ /Manetti Bros/)
                 director_name = "The Manetti Bros."
             if (director_name ~ /Andrea and Antonio Frazzi/)
@@ -394,7 +409,7 @@
     # in most cases, showSeasons = the final season number, i.e.
     # a show with two seasons would have seasons 1 and 2
     finalSeason = showSeasons
-    # Special case any discontinuous seasons, e.g. 2 seasons, but numbered 1 and 3
+    # Special case discontinuous seasons, e.g. 2 seasons, but numbered 1 and 3
     if (showURL ~ /\/wallander$/)
         finalSeason = 3
     #


Languages: fix show() and s() in case FriBidi is not properly initialized

--- include/Languages.awk
+++ include/Languages.awk
@@ -1379,8 +1379,8 @@
         if (Cache[text][0])
             return Cache[text][0]
         else {
-            if (FriBidi || (code && isRTL(code)))
-                ("echo " parameterize(text) " | " BiDiNoPad) | getline temp
+            if ((FriBidi || (code && isRTL(code))) && BiDiNoPad)
+                ("echo " parameterize(text) PIPE BiDiNoPad) | getline temp
             else # non-RTL language, or FriBidi not installed
                 temp = text
             return Cache[text][0] = temp
@@ -1399,8 +1399,8 @@
         if (Cache[text][width])
             return Cache[text][width]
         else {
-            if (FriBidi || (code && isRTL(code)))
-                ("echo " parameterize(text) " | " sprintf(BiDi, width)) | getline temp
+            if ((FriBidi || (code && isRTL(code))) && BiDi)
+                ("echo " parameterize(text) PIPE sprintf(BiDi, width)) | getline temp
             else # non-RTL language, or FriBidi not installed
                 temp = text
             return Cache[text][width] = temp


Correction.

Correction.

git-svn-id: 293778eaa97c8c94097d610b1bd5133a8f478f36@33852 4f837ed2-42f5-46e7-a7a5-fa17313484d4

--- scripts/tdb/statuses_gln.awk
+++ scripts/tdb/statuses_gln.awk
@@ -36,7 +36,7 @@
           r[pn] = "4"
         } else if ((substr(p[pn],1,2) >= "CA") && (substr(p[pn],1,2) <= "Rz")) {
           r[pn] = "5"
-        } else if (substr(p[pn],1,1) >= "SA") {
+        } else if (substr(p[pn],1,2) >= "SA") {
           r[pn] = "8"
         }
       }


Fixed tagXSstrandedData.awk script.

Fixed tagXSstrandedData.awk script.

--- extras/scripts/tagXSstrandedData.awk
+++ extras/scripts/tagXSstrandedData.awk
@@ -6,11 +6,9 @@

 {

-    printf $0;
-
-    if (substr($1,1,1)=="@")
-    {# header - nothing to do
-        printf "\n";
+    if (substr($1,1,1)=="@" || $4==0)
+    {# header, or unmapped read - just print
+        print;
         next;
     };

@@ -25,11 +23,11 @@
     };

     if (mate>0 && mate <3)
-    {# mate is defined
+    {# mate is defined - add XS tag
        if (mate!=strType) str=1-str; #revert strand if the mate is opposite
-       printf "\t" "XS:A:" strSym[str];
+       print $0 "\t" "XS:A:" strSym[str];
+    } else
+    {# mate is not defined - just print
+       print;
     };
-
-    printf "\n";
-
 }


Now toloka.awk can process multiple inputs

--- misc/toloka.awk
+++ misc/toloka.awk
@@ -3,10 +3,10 @@
     FS = OFS = "\t";
     print "INPUT:hyponym", "INPUT:hypernym", "INPUT:genitive", "GOLDEN:judgement", "HINT:text";
 }
-NR == 1 {
+FNR == 1 {
     for (i=1; i<=NF; i++) ix[$i] = i;
     next;
 }
-$ix["found"] {
+{
     print $ix["hyponym"], $ix["hypernym"], $ix["genitive"], "", "" | "sort -t \"\t\" -k1,1 -k2,2 -k3,3 -u";
 }


fix copyright headers

fix copyright headers

--- awk/typegraph.awk
+++ awk/typegraph.awk
@@ -1,7 +1,16 @@
-# Copyright (c) AT&T Corp. 1994, 1995.
-# This code is licensed by AT&T Corp.  For the
-# terms and conditions of the license, see
-# http://www.research.att.com/orgs/ssr/book/reuse
+#
+# /**********************************************************
+# *      This software is part of the graphviz package      *
+# *                http://www.graphviz.org/                 *
+# *                                                         *
+# *            Copyright (c) 1994-2005 AT&T Corp.           *
+# *                and is licensed under the                *
+# *            Common Public License, Version 1.0           *
+# *                      by AT&T Corp.                      *
+# *                                                         *
+# *        Information and Software Systems Research        *
+# *              AT&T Research, Florham Park NJ             *
+# **********************************************************/

 BEGIN	{
 			n_names = 0;


Missing newline in error message in summarize.awk

--- testsuite/makefiles/summarize.awk
+++ testsuite/makefiles/summarize.awk
@@ -169,7 +169,7 @@
             if (nresults == passed + skipped + failed + unexped){
                 printf ("\n");
             }else{
-                printf (" (totals don't add up??)");
+                printf (" (totals don't add up??)\n");
             }
             if (reran != 0){
                 printf("  %3d test dir re-runs\n", reran);


Changed ini adt to use : instead of SUBSEP

--- lib/config.awk
+++ lib/config.awk
@@ -1,5 +1,7 @@
 # awk library to parse config file

+
+BEGIN {INI_SEP = ":"}
 # converts string containing rules into dict
 # note, does not clear out dest array
 # string must be an ini file fragment
@@ -36,14 +38,14 @@

 # converts array to a rule string. NOT an ini.
 function ini_arr2frag(array,     frag, key, val, line) {
-	frag = "HASH" SUBSEP
+	frag = "HASH" INI_SEP
 	for (key in array) {
 		# escape newlines using @ and \n values
 		val = array[key]
 		gsub("@", "@@", val)
 		gsub("\n", "@n", val)

-		line = key "=" "STR" SUBSEP val "\n"
+		line = key "=" "STR" INI_SEP val "\n"
 		frag = frag line
 	}
 	# if we have added at least one line, we need to chop off the end
@@ -56,7 +58,7 @@

 # converts ini to a rule string. NOT a raw array
 function ini_ini2frag(array,     frag, key, val, line) {
-	frag = "HASH" SUBSEP
+	frag = "HASH" INI_SEP
 	for (key in array) {
 		# escape newlines using @ and \n values
 		val = array[key]
@@ -103,19 +105,19 @@
 	return retval
 }

-# format of a fragment: TYPE SUBSEP VALUE
+# format of a fragment: TYPE INI_SEP VALUE

 # returns the type of a fragment
 function ini_type(frag,   i) {
-	i = index(frag, SUBSEP)
-	if (i == 0) die(sprintf("Expected SUBSEP in fragment: %s", frag))
+	i = index(frag, INI_SEP)
+	if (i == 0) die(sprintf("Expected INI_SEP in fragment: %s", frag))
 	return substr(frag, 1, i-1)
 }

 # returns the value of a fragment
 function ini_val(frag,   i) {
-	i = index(frag, SUBSEP)
-	if (i == 0) die("Expected SUBSEP in fragment")
+	i = index(frag, INI_SEP)
+	if (i == 0) die("Expected INI_SEP in fragment")
 	return substr(frag, i+1)
 }

@@ -147,7 +149,7 @@

 function ini_add_str(ini, key, val) {
 	if (key == "") die("cannot have empty key")
-	ini[key] = "STR" SUBSEP val
+	ini[key] = "STR" INI_SEP val
 }

 # gets the rules that apply to a specific path
@@ -244,7 +246,7 @@
 	key = substr($0, 1, n-1)
 	val = substr($0, n+1)
 	if (cur_rule_str in adt)
-		adt[cur_rule_str] = adt[cur_rule_str] "\n" key "=STR" SUBSEP val
+		adt[cur_rule_str] = adt[cur_rule_str] "\n" key "=STR" INI_SEP val
 	else
-		adt[cur_rule_str] = "HASH" SUBSEP key"=STR" SUBSEP val
-}
+		adt[cur_rule_str] = "HASH" INI_SEP key"=STR" INI_SEP val
+}


rnc2rng.awk: Better handling of data types and params

--- rnc2rng.awk
+++ rnc2rng.awk
@@ -188,6 +188,7 @@
     txt = substr(line, 2);
     sub(/".*/, "", txt)
     stack[++stack_i] = "<value>" txt "</value>";
+    postop = 0;
     if (length(line) >= length(txt) + 3)
       parse_pattern(substr(line, length(txt) + 3));
   }
@@ -227,6 +228,7 @@
     stack[++stack_i] = "<text/>";
     aft = substr(line, 5);
     sub(/^ */, "", aft);
+    postop = 0;
     if (aft != "") { parse_pattern(aft); }
   }
   else if (match(line, "^default namespace ")) {
@@ -253,11 +255,39 @@
     name = substr(line, 1);
     sub(/^xsd:/, "", name);
     sub(/[^A-Za-z_.-]+.*/, "", name);
-    stack[++stack_i] = sprintf("<data type='%s' datatypeLibrary='http://www.w3.org/2001/XMLSchema-datatypes'/>",
+    stack[++stack_i] = sprintf("<data type='%s' datatypeLibrary='http://www.w3.org/2001/XMLSchema-datatypes'",
                                name);
     postop = 0;
+    aft = "";
     if (length(line) >= length(name) + 5) {
       aft = substr(line, length(name) + 5);
+      sub(/^ */, "", aft)
+    }
+    if (substr(aft, 1, 1) == "{") {
+      stack[stack_i] = stack[stack_i] ">";
+      aft = substr(aft, 2);
+      while (aft != "" && substr(aft, 1, 1) != "}") {
+        sub(/^ */, "", aft);
+        subpos = index(aft, "=");
+        paramname = substr(aft, 1, subpos - 1);
+        sub(/ *$/, "", paramname);
+        aft = substr(aft, subpos);
+        subpos = index(aft, "\"");
+        aft = substr(aft, subpos + 1);
+        subpos = index(aft, "\"");
+        paramval = substr(aft, 1, subpos - 1);
+        aft = substr(aft, subpos + 1);
+        sub(/^ */, "", aft);
+        stack[stack_i] = stack[stack_i] sprintf("<param name='%s'>%s</param>", paramname, paramval);
+      }
+      stack[stack_i] = stack[stack_i] "</data>";
+      if (aft != "")
+        aft = substr(aft, 2);
+    }
+    else {
+      stack[stack_i] = stack[stack_i] "/>";
+    }
+    if (aft != "") {
       parse_pattern(aft);
     }
   }
@@ -267,7 +297,10 @@
     }
     name = substr(line, 1);
     sub(/[^A-Za-z_.-]+.*/, "", name);
-    if (name == "empty") {
+    if (name == "string") {
+      stack[++stack_i] = "<data type='string'/>";
+    }
+    else if (name == "empty") {
       stack[++stack_i] = "<empty/>";
     }
     else if (name == "notAllowed") {
@@ -354,7 +387,7 @@
       error = 1;
       exit 1
     }
-    if (length(open) == 1 || substr(open, 2, 1) != "|") {
+    if (length(open) == 2 && substr(open, 2, 1) != "|") {
       print "Unknown name class pattern on line " FNR | "cat 1>&2";
       error = 1;
       exit 1
@@ -505,8 +538,8 @@
   }
 }

-mode == "pattern" && paren_i == 0 && /.*=/ { mode = "grammar"; }
-mode == "grammar" && /.*=/ {
+mode == "pattern" && paren_i == 0 && /^[^{(]*=/ { mode = "grammar"; }
+mode == "grammar" && /^[^{(]*=/ {
   if (match($0, "^default namespace ")) {
     namespace = substr($0, index($0, "=") + 1);
     nsname = substr($0, 19, index($0, "=") - 19);


Fix: bracket expression matches a character at gawk

This is a trivial patch. However, It's must be modified by gawk.
Check it exactly as a plain character (e.g., space, alnum)
within the bracket expression at ./coreclr/generateversionscript.awk

Signed-off-by: Geunsik Lim <acd8f4539166019ed6425de5f67e6d834f46e5a4@samsung.com>

--- generateversionscript.awk
+++ generateversionscript.awk
@@ -8,7 +8,7 @@
 	gsub(/\r/,"", $0);

 	# Skip empty lines and comment lines starting with semicolon
-	if (NF && !match($0, /^[:space:]*;/))
+	if (NF && !match($0, /^[[:space:]]*;/))
 	{
 		print "        "  $0 ";";
 	}


test: reimplement assertEqual() and assertNotEqual()

--- test.awk
+++ test.awk
@@ -36,70 +36,17 @@
 }

 function assertEqual(x, y, name, message, ansiCode,    i) {
-    if (isarray(x) && !isarray(y)) {
-        if (!message)
-            message = "assertEqual: EXPECTED SCALAR VALUE " ansi("underline", y) ", GOT:"
-        fail(name, message, ansiCode)
-        da(x)
-
-    } else if (!isarray(x) && isarray(y)) {
-        if (!message)
-            message = "assertEqual: GOT SCALAR VALUE " ansi("underline", x) ", EXPECTED:"
-        fail(name, message, ansiCode)
-        da(y)
-
-    } else if (isarray(x) && isarray(y)) {
-        if (length(x) != length(y)) {
-            if (!message)
-                message = "assertEqual: ARRAY LENGTH "                  \
-                    ansi("underline", length(x)) " != " ansi("underline", length(y))
-            fail(name, message, ansiCode)
-
-        } else {
-            for (i in x) {
-                if (x[i] != y[i]) {
-                    if (!message)
-                        message = "assertEqual: ARRAY[" i "] "          \
-                            ansi("underline", x[i]) " != " ansi("underline", y[i])
-                    fail(name, message, ansiCode)
-                    return
-                }
-            }
-            pass(name, "", ansiCode)
-        }
-
-    } else {
-        if (!message)
-            message = "assertEqual: " ansi("underline", x)      \
-                " IS NOT EQUAL TO " ansi("underline", y)
-        assertTrue(x == y, name, message, ansiCode)
-    }
+    if (!message)
+        message = "assertEqual: " ansi("underline", toString(x, 1))     \
+            " IS NOT EQUAL TO " ansi("underline", toString(y, 1))
+    assertTrue(identical(x, y), name, message, ansiCode)
 }

 function assertNotEqual(x, y, name, message, ansiCode,    i) {
-    if (isarray(x) && isarray(y)) {
-        if (length(x) != length(y))
-            pass(name, "", ansiCode)
-        else {
-            for (i in x) {
-                if (x[i] != y[i]) {
-                    pass(name, "", ansiCode)
-                    return
-                }
-            }
-            if (!message)
-                message = "assertNotEqual: TWO ARRAYS ARE IDENTICAL"
-            fail(name, message, ansiCode)
-        }
-
-    } else if (!isarray(x) && !isarray(y)) {
-        if (!message)
-            message = "assertNotEqual: " ansi("underline", x)   \
-                " IS EQUAL TO " ansi("underline", y)
-        assertFalse(x == y, name, message, ansiCode)
-
-    } else
-        pass(name, "", ansiCode)
+    if (!message)
+        message = "assertNotEqual: " ansi("underline", toString(x, 1))  \
+            " IS EQUAL TO " ansi("underline", toString(y, 1))
+    assertFalse(identical(x, y), name, message, ansiCode)
 }

 function T(test, total) {


Add Newton's Law bonus

Add Newton's Law bonus

--- getAcornFrom-seriesPages.awk
+++ getAcornFrom-seriesPages.awk
@@ -229,8 +229,8 @@
     # Default bonus, parttwo, and christmasspecials episodeType to "X"
     if (episodeURL ~ /bonus\/|[0-9]{1,2}parttwo\/|christmasspecial\//)
         episodeType = "X"
-    # jamaicainn & newworlds bonus seasonNumber should be 1
-    if (episodeURL ~ /\/jamaicainn\/bonus\/|\/newworlds\/bonus\// && seasonNumber != 1) {
+    # jamaicainn, newworlds & newtonslaw bonus seasonNumber should be 1
+    if (episodeURL ~ /\/jamaicainn\/bonus\/|\/newworlds\/bonus\/|\/newtonslaw\/bonus\// && seasonNumber != 1) {
         split (episodeURL, part, "/")
         printf ("==> Corrected mismatch: https://acorn.tv/%s/%s was series %d\n", \
                part[4], part[5], seasonNumber) >> ERROR_FILE


looser pattern for shell scripts and some other C files


INTEGRATION: CWS locdat24 (1.5.212); FILE MERGED 2007/12/29 17:40:56 erack 1.5.212.1: joined from cws locales30

--- i18npool/source/localedata/data/currency-check.awk
+++ i18npool/source/localedata/data/currency-check.awk
@@ -44,7 +44,7 @@
         crlf = 1
         exit(1)
     }
-    if ( $1 ~ /^<LC_FORMAT$/ )
+    if ( $1 ~ /^<LC_FORMAT(>|$)/ )
     {
         if ( $0 ~ /replaceFrom="\[CURRENCY\]"/ )
         {
@@ -64,7 +64,7 @@
             }
         }
     }
-    else if ( $1 ~ /^<FormatElement$/ )
+    else if ( $1 ~ /^<FormatElement(>|$)/ )
     {
         if ( $0 ~ /usage="CURRENCY"/ )
         {
@@ -92,7 +92,7 @@
         }
         bFormatAuto = 0
     }
-    else if ( $1 ~ /^<LC_CURRENCY$/ )
+    else if ( $1 ~ /^<LC_CURRENCY(>|$)/ )
     {
         for ( j=2; j<=NF; ++j )
         {
@@ -136,7 +136,7 @@

 function getCurrencyParams() {
-    if ( $1 ~ /^<Currency$/ )
+    if ( $1 ~ /^<Currency(>|$)/ )
     {
         if ( $0 ~ /default="true"/ )
             bSymbolDefault = 1


properly remove shite

properly remove shite

--- scripts/hinter.awk
+++ scripts/hinter.awk
@@ -108,7 +108,6 @@

   hint_format = "\033[1;33m[%s]\033[0m"
   highlight_format = "\033[1;33m%s\033[0m "
-  printf "%s\n", finger_patterns | "cat 1>&4"
   hint_lookup = ""
 }


rnc2rng.awk: Support "empty"

rnc2rng.awk: Support "empty"

--- rnc2rng.awk
+++ rnc2rng.awk
@@ -215,7 +215,12 @@
   else if (match(line, /^[A-Za-z_]/)) {
     name = substr(line, 1);
     sub(/[^A-Za-z_]+.*/, "", name);
-    stack[++stack_i] = sprintf("<ref name='%s'/>", name);
+    if (name == "empty") {
+      stack[++stack_i] = "<empty/>";
+    }
+    else {
+      stack[++stack_i] = sprintf("<ref name='%s'/>", name);
+    }
     if (length(line) >= length(name) + 1) {
       aft = substr(line, length(name) + 1);
       parse_pattern(aft);


hr75: #i116747#: remove obsolete copyright notices

--- sw/inc/poolfmt.awk
+++ sw/inc/poolfmt.awk
@@ -1,15 +1,28 @@
 #*************************************************************************
-#*
-#*    $Workfile:        dbgxtor.awk
-#*
-#*    Ersterstellung    JP  05.10.95
-#*    Letzte Aenderung  $Author: hr $ $Date: 2000-09-18 17:14:27 $
-#*    $Revision: 1.1.1.1 $
-#*
-#*    $Logfile:   T:/sw/inc/poolfmt.awv  $
-#*
-#*    Copyright (c) 1990-1996, STAR DIVISION
-#*
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org.  If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
 #*************************************************************************

 #


Commons: add escapeChar()

Commons: add escapeChar()

--- lib/Commons.awk
+++ lib/Commons.awk
@@ -1,4 +1,27 @@
 #!/usr/bin/gawk -f
+
+# Return the real character represented by an escape sequence.
+# Example: escapeChar("n") returns "\n".
+# See: <https://en.wikipedia.org/wiki/Escape_character>
+#      <https://en.wikipedia.org/wiki/Escape_sequences_in_C>
+function escapeChar(char) {
+    switch (char) {
+    case "b":
+        return "\b" # Backspace
+    case "f":
+        return "\f" # Formfeed
+    case "n":
+        return "\n" # Newline (Line Feed)
+    case "r":
+        return "\r" # Carriage Return
+    case "t":
+        return "\t" # Horizontal Tab
+    case "v":
+        return "\v" # Vertical Tab
+    default:
+        return char
+    }
+}

 # Convert a literal-formatted string into its original string.
 function literal(string,
@@ -13,7 +36,7 @@
     for (i = 2; i < length(s); i++) {
         c = s[i]
         if (escaping) {
-            string = string c
+            string = string escapeChar(c)
             escaping = 0 # escape ends
         } else {
             if (c == "\\")