X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=input.cs;h=5b3cf202db0542b0f714a96ad6a782129d568578;hb=3c39b282b53d78ca6e76ababf377aec3a081303a;hp=db38833c8f9a71a32e7a774152f08708706df6b4;hpb=15afd301194e834e8313cdd5fab4e86593e3b75b;p=m17n%2Fm17n-lib-cs.git diff --git a/input.cs b/input.cs index db38833..5b3cf20 100644 --- a/input.cs +++ b/input.cs @@ -10,39 +10,15 @@ using Xex = System.Xml.Expression.Xexpression; public class Test { - public static void Main() + public static void Main(string[] args) { //M17n.debug = true; + Xex.debug_level = 10; MDatabase.ApplicationDir = "/usr/local/share/m17n"; - -#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 true MInputMethod im = MInputMethod.Find ("vi", "telex"); - - im.Open (); - Console.WriteLine (im); -#else - MText desc, title; - Xex.Variable[] vars; - MInputMethod.Command[] cmds; - 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 + MInputMethod.Context ic = new MInputMethod.Context (im); + MText str = args[0]; + for (int i = 0; i < str.Length; i++) + ic.Filter (new MInputMethod.Key (str[i])); } }