--- /dev/null
+# SCRIPT.awk -- awk script to generate SCRIPT.tab
+# Copyright (C) 2007
+# National Institute of Advanced Industrial Science and Technology (AIST)
+# Registration Number H15PRO112
+
+# This file is part of the m17n database; a sub-part of the m17n
+# library.
+
+# The m17n library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1 of
+# the License, or (at your option) any later version.
+
+# The m17n library 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 for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with the m17n library; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+BEGIN {
+ tohex["0"] = 1;
+ tohex["1"] = 2;
+ tohex["2"] = 3;
+ tohex["3"] = 4;
+ tohex["4"] = 5;
+ tohex["5"] = 6;
+ tohex["6"] = 7;
+ tohex["7"] = 8;
+ tohex["8"] = 9;
+ tohex["9"] = 10;
+ tohex["A"] = 11;
+ tohex["B"] = 12;
+ tohex["C"] = 13;
+ tohex["D"] = 14;
+ tohex["E"] = 15;
+ tohex["F"] = 16;
+ tohex["a"] = 11;
+ tohex["b"] = 12;
+ tohex["c"] = 13;
+ tohex["d"] = 14;
+ tohex["e"] = 15;
+ tohex["f"] = 16;
+
+ FS = "[ \t]*[;#][ \t]*";
+ initialized = 0;
+ charcount = 0;
+ range_index = 0;
+}
+
+function decode_hex(str, idx) {
+ n = 0;
+ len = length(str);
+ for (i = idx; i <= len; i++) {
+ c = tohex[substr(str, i, 1)];
+ if (c == 0)
+ break;
+ n = n * 16 + c - 1;
+ }
+ return n;
+}
+
+function initialize() {
+ first = -1;
+ while (getline line < "UNIDATA/UnicodeData.txt" > 0) {
+ if (line ~ /^[0-9A-F][0-9A-F]*/) {
+ last = decode_hex(line, 1);
+ if (first >= 0) {
+ range[range_index++] = first;
+ range[range_index++] = last;
+ first = -1;
+ } else if (line ~ /First>/) {
+ first = last;
+ } else {
+ exists[last] = 1;
+ }
+ }
+ }
+}
+
+function char_exist_p(c) {
+ if (exists[c] == 1)
+ return 1;
+ for (i = 0; i < range_index; i += 2)
+ if (range[i] >= c && range[i + 1] <= c)
+ return 1;
+ return 0;
+}
+
+function maybe_emit(ch1, ch2, this_script) {
+ if (initialized == 0) {
+ initialize();
+ initialized = 1;
+ print "# Ranges may contain non-existing character codes.";
+ print "0x0-0x3FFFFF common";
+ first = ch1;
+ last = ch2;
+ script = this_script;
+ } else {
+ if (script == this_script) {
+ for (j = last + 1; j < ch1; j++)
+ if (char_exist_p(j))
+ break;
+ if (j == ch1) {
+ last = ch2;
+ return;
+ }
+ }
+ if (script != "Common") {
+ if (first == last)
+ printf "0x%04X %s\n", first, tolower(script);
+ else
+ printf "0x%04X-0x%04X %s\n", first, last, tolower(script);
+ }
+ first = ch1;
+ last = ch2;
+ script = this_script;
+ }
+}
+
+/^[0-9A-F]+\.\./ {
+ maybe_emit(decode_hex($0, 1), decode_hex($0, match($0, "\.\.") + 2), $2);
+ next;
+}
+
+/^[0-9A-F]/ {
+ ch = decode_hex($0, 1);
+ maybe_emit(ch, ch, $2);
+ next;
+}
+
+END {
+ if (script != "Common") {
+ if (first == last)
+ printf "0x%04X %s\n", first, tolower (script);
+ else
+ printf "0x%04X-0x%04X %s\n", first, last, tolower (script);
+ }
+ while (getline < "SCRIPT.ext" > 0) {
+ if ($0 ~ /^[0-9A-F][0-9A-F]*/) {
+ print;
+ }
+ }
+
+}
--- /dev/null
+# SCRIPT.ext -- Extra scripts definition (not yet in Unicode)
+# Copyright (C) 2007
+# National Institute of Advanced Industrial Science and Technology (AIST)
+# Registration Number H15PRO112
+
+# This file is part of the m17n database; a sub-part of the m17n
+# library.
+
+# The m17n library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1 of
+# the License, or (at your option) any later version.
+
+# The m17n library 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 for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with the m17n library; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+0xAA80-0xAADF tayviet
--- /dev/null
+;; unicode.mim -- Input method for Unicode characters by typing character code
+;; Copyright (C) 2007
+;; National Institute of Advanced Industrial Science and Technology (AIST)
+;; Registration Number H15PRO112
+
+;; This file is part of the m17n database; a sub-part of the m17n
+;; library.
+
+;; The m17n library is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU Lesser General Public License
+;; as published by the Free Software Foundation; either version 2.1 of
+;; the License, or (at your option) any later version.
+
+;; The m17n library 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 for more details.
+
+;; You should have received a copy of the GNU Lesser General Public
+;; License along with the m17n library; if not, write to the Free
+;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+(input-method fr azerty)
+
+(documentation (_"Simulating Azerty keyboard on English keyboard.
+
+ &1 é2 \"3 '4 (5 -6 è7 _8 ç9 à0 )° =_ ²~
+ aA zZ eE rR tT yY uU iI oO pP ^¨ $£
+ qQ sS dD fF gG hH jJ kK lL mM ù% *|
+ wW xX cC vV bB nN ,? ;. :/ !§
+
+'[' and '{' are used as a dead key to type a character with the
+circumflex and diaeresis respectively (e.g. '[' 'e' -> \"ê\").
+
+'Alt-2' and 'Alt-7' are used as a dead key to type a character
+with tilde and grave respectively (e.g. 'Alt-2' 'n' -> \"ñ\").
+
+'Ctrl-Alt-2' and 'Ctrl-Alt-7' can be used as 'Alt-2' and 'Alt-7'
+respectively.
+
+Azerty keyboard has one more key at the bottom left corner for
+inputting \"<\" and \">\". As a normal English keyboard doesn't
+have such a key left, type '<' and '>' twice for \"<\" and \">\"
+respectively."))
+
+(title "AZ ")
+
+(map
+ (normal
+ ("1" ?&)
+ ("2" ?é)
+ ("3" ?\")
+ ("4" ?')
+ ("5" ?\()
+ ("6" ?-)
+ ("7" ?è)
+ ("8" ?_)
+ ("9" ?ç)
+ ("0" ?à)
+ ("-" ?\))
+ ("=" ?=)
+ ("`" ?²)
+ ("q" ?a)
+ ("w" ?z)
+ ("e" ?e)
+ ("r" ?r)
+ ("t" ?t)
+ ("y" ?y)
+ ("u" ?u)
+ ("i" ?i)
+ ("o" ?o)
+ ("p" ?p)
+ ;; ("[" ?^)
+ ("]" ?$)
+ ("a" ?q)
+ ("s" ?s)
+ ("d" ?d)
+ ("f" ?f)
+ ("g" ?g)
+ ("h" ?h)
+ ("j" ?j)
+ ("k" ?k)
+ ("l" ?l)
+ (";" ?m)
+ ("'" ?ù)
+ ("\\" ?*)
+ ("z" ?w)
+ ("x" ?x)
+ ("c" ?c)
+ ("v" ?v)
+ ("b" ?b)
+ ("n" ?n)
+ ("m" ?,)
+ ("," ?\;)
+ ("." ?:)
+ ("/" ?!)
+
+ ("!" ?1)
+ ("@" ?2)
+ ("#" ?3)
+ ("$" ?4)
+ ("%" ?5)
+ ("^" ?6)
+ ("&" ?7)
+ ("*" ?8)
+ ("(" ?9)
+ (")" ?0)
+ ("_" ?°)
+ ("+" ?+)
+ ("~" ?~)
+ ("Q" ?A)
+ ("W" ?Z)
+ ("E" ?E)
+ ("R" ?R)
+ ("T" ?T)
+ ("Y" ?Y)
+ ("U" ?U)
+ ("I" ?I)
+ ("O" ?O)
+ ("P" ?P)
+ ;; ("{" ?¨)
+ ("}" ?£)
+
+ ("A" ?Q)
+ ("S" ?S)
+ ("D" ?D)
+ ("F" ?F)
+ ("G" ?G)
+ ("H" ?H)
+ ("J" ?J)
+ ("K" ?K)
+ ("L" ?L)
+ (":" ?M)
+ ("\"" ?%)
+ ("|" ?µ)
+ ("Z" ?W)
+ ("X" ?X)
+ ("C" ?C)
+ ("V" ?V)
+ ("B" ?B)
+ ("N" ?N)
+ ("M" ??)
+ ("<" ?.)
+ ("<<" ?<)
+ (">" ?/)
+ (">>" ?>)
+ ("?" ?§))
+
+ ;; Deadkeys
+ (left-square-bracket
+ ("[" (shift circumflex)))
+
+ (left-curly-bracket
+ ("{" (shift diaeresis)))
+
+ (alt-2-7
+ ((A-2) (shift tilde))
+ ((A-7) (shift grave)))
+
+ (ctrl-alt-2-7
+ ((C-A-2) (shift tilde))
+ ((C-A-7) (shift grave)))
+
+ ;; Letters with diacritical marks
+ (circumflex
+ ("[" ?^)
+ ("q" ?â)
+ ("e" ?ê)
+ ("i" ?î)
+ ("o" ?ô)
+ ("u" ?û)
+ ("Q" ?Â)
+ ("E" ?Ê)
+ ("I" ?Î)
+ ("O" ?Ô)
+ ("U" ?Û))
+
+ (diaeresis
+ ("{" ?¨)
+ ("q" ?ä)
+ ("e" ?ë)
+ ("i" ?ï)
+ ("o" ?ö)
+ ("u" ?ü)
+ ("y" ?ÿ)
+ ("Q" ?Ä)
+ ("E" ?Ë)
+ ("I" ?Ï)
+ ("O" ?Ö)
+ ("U" ?Ü)
+ ("Y" ?Ÿ))
+
+ (tilde
+ ("3" ?~)
+ ("q" ?ã)
+ ("n" ?ñ)
+ ("o" ?õ))
+
+ (grave
+ ("q" ?à)
+ ("e" ?è)
+ ("i" ?ì)
+ ("o" ?ò)
+ ("u" ?ù)
+ ("Q" ?À)
+ ("E" ?È)
+ ("I" ?Ì)
+ ("O" ?Ò)
+ ("U" ?Ù)))
+
+(state
+ (init
+ (normal)
+ (left-square-bracket)
+ (left-curly-bracket)
+ (alt-2-7)
+ (ctrl-alt-2-7))
+
+ (circumflex
+ "AZ^"
+ (circumflex (shift init)))
+
+ (diaeresis
+ "AZ¨"
+ (diaeresis (shift init)))
+
+ (tilde
+ "AZ~"
+ (tilde (shift init)))
+
+ (grave
+ "AZ`"
+ (grave (shift init))))