using System; using System.Collections.Generic; using System.IO; using System.Xml; using System.Xml.Expression; using M17N; using M17N.Core; using M17N.Input; using Xex = System.Xml.Expression.Xexpression; public class Test { public static void Main() { //M17n.debug = true; MDatabase.ApplicationDir = "/usr/local/share/m17n"; MText desc, title; Xex.Variable[] vars; MInputMethod.Command[] cmds; #if false MDatabase.Tag tag = new MDatabase.Tag ("input-method", "t", "nil", "vi-base"); MDatabase mdb = MDatabase.Find (tag); XmlNode node = mdb.Load ("map-alnum", "input-method", "map-list", "map"); Console.WriteLine (node.OuterXml); #elif false MInputMethod im = MInputMethod.Find ("vi", "telex"); if (im.Info (out desc, out title, out vars, out cmds)) { Console.WriteLine ("{0}, {1}, {2}, {3}", desc, title, vars, cmds); im.Open (); } #else MInputMethod[] ims = MInputMethod.List (); foreach (MInputMethod im in ims) { Console.Write ("(<{0}, {1}, {2}>", im.Language, im.Name, im.SubName); if (im.Info (out desc, out title, out vars, out cmds)) Console.Write (" {0}, {1}, {2}, {3}", desc, title, vars, cmds); if (! im.Open ()) Console.Write (" open fail"); Console.WriteLine (")"); } #endif } }