From 0862e20f358e93957a4f5cb10b571d015f33fa96 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Wed, 9 Nov 2011 13:21:57 +0800 Subject: add genpinyin2.awk --- scripts/Makefile.data | 9 +++++++++ scripts/genpinyin2.awk | 8 ++++++++ 2 files changed, 17 insertions(+) create mode 100644 scripts/Makefile.data create mode 100644 scripts/genpinyin2.awk (limited to 'scripts') diff --git a/scripts/Makefile.data b/scripts/Makefile.data new file mode 100644 index 0000000..2f665b2 --- /dev/null +++ b/scripts/Makefile.data @@ -0,0 +1,9 @@ +all: pinyin2.txt + + +pinyin2.txt: + awk -f genpinyin2.awk ../data/gb_char.table > $@ + + +.PHONY: pinyin2.txt + diff --git a/scripts/genpinyin2.awk b/scripts/genpinyin2.awk new file mode 100644 index 0000000..00c6cad --- /dev/null +++ b/scripts/genpinyin2.awk @@ -0,0 +1,8 @@ +#!/usr/bin/awk + { if (length($2) == 2) pinyins[$1] += $4 } + +END { + for (pinyin in pinyins) { + print pinyin, pinyins[pinyin] + } +} -- cgit