X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=chartab.cs;h=7262d93606eda959e1650fc8e2b854803e7a525e;hb=7e9120e82093e8c321f5cfdf05fcbfbd51cb0adc;hp=78e2a29f2b8de3f77b2ed8defbd37da0f47640eb;hpb=9db8c225f7679dc803ac309aa6d8f24bbb626972;p=m17n%2Fm17n-lib-cs.git diff --git a/chartab.cs b/chartab.cs index 78e2a29..7262d93 100644 --- a/chartab.cs +++ b/chartab.cs @@ -16,6 +16,7 @@ public class Test tbl[0x1000] = MSymbol.Of ("test-1000"); tbl[0x2070, 0x4001] = MSymbol.t; + tbl[0x3740] = MSymbol.nil; Console.WriteLine ("# Direct access by tbl[CHAR]"); Console.WriteLine ("0x100:{0}, 0x1000:{1}", tbl[0x100], tbl[0x1000]); @@ -26,10 +27,23 @@ public class Test foreach (MCharRange range in tbl) Console.WriteLine (range); - Console.WriteLine ("# Using CharRange from U+3000 to U+0"); + Console.WriteLine ("# Using MCharRange from U+3000 to U+0"); MCharRange r = new MCharRange (0x3000, tbl); do { - Console.WriteLine (r); + if (r.Value != null) + Console.WriteLine (r); } while (r.Prev ()); + + Console.WriteLine ("# Using MCharProp of BIDI"); + MDatabase.ApplicationDir = "/usr/local/share/m17n"; + MCharProp bidi = new MCharProp (MSymbol.Of ("bidirectional-category")); + r = new MCharRange (0, bidi); + while (r.To < 0x800) + { + if (r.Value != null) + Console.WriteLine (r); + r.Next (); + } + Console.WriteLine ("..."); } }