*** empty log message ***
[m17n/m17n-lib-cs.git] / input.cs
index db38833..5b3cf20 100644 (file)
--- 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]));
   }
 }