Re: TIM - A Table-base Input Method Module



FWD: (The first one was on hold due to the posting from different
(Baddress)
(B
(B--
(Bhiura {{li18nux,freestandards,unicode}.org,sun.com} http://www.li18nux.org
(BChair, Li18nux/Linux Internationalization Initiative, Free Standards Group
(BArchitect/Sr. Staff Engineer, Sun Microsystems, Inc, USA  FAX 650-786-9553
(B--------------------------------------------------------------------------
(BSubject: Re: TIM - A Table-base Input Method Module
(BFrom: hiura sun com (Hideki Hiura)
(BTo: Arthit Suriyawongkul sun com
(BCc: unicode unicode org, dev l10n openoffice org, tlwg yahoogroups com,
(B li18nux-im li18nux org, himi li18nux org
(BDate: Mon, 22 Jul 2002 02:50:02 -0700 (PDT)
(BX-Mailer: Mew version 1.95b43 on Emacs 20.7 / Mule 4.1 (AOI)
(B
(B> From: Arthit Suriyawongkul <Arthit Suriyawongkul sun com>
(B> anybody here interesting in this Table-based Input Method ?
(B>   http://sourceforge.net/projects/wenju/
(B> i've got this site from gtk-i18n-list.
(B
(BI have not looked at this one yet, but you may also want to take a look at
(BIIIMF(http://www.li18nux.org/subgroup/im/IIIMF) which has something similar,
(Bcalled ude(user defined engine) as a table based IM.
(BAlso recently, XML based IM, EIMIL(Extensible IM interface Language) is 
(Bintroduced to IIIMF, which you can combine the table based IM, the
(Bportable XML based logics, and backend dictionay lookup server.
(B
(BYou can retrive the source of this as follows;
(B
(Bcvs -d:pserver:anonymous cvs li18nux org:/cvsroot co -r exp-EIMIL-1 im-sdk
(B
(BThe following is the sample XML based IM definition, which you can
(Bfind in im-sdk/server/programs/language_engines/canna.
(B
(BThis sample shows how you can combine those table/logic and backend
(Bdictionary lookup server(in this case, Japanese Canna dictionary
(Blookup server).
(B
(B-------------------------------------------------------------------------------
(B<?xml version="1.0"?>
(B<!DOCTYPE ccdef PUBLIC "-//Li18nux//DTD CCDEF 1.0//EN"
(B                "ccdef.dtd">
(B
(B<ccdef name="default" class="org.li18nux.CannaLE" revision="0.1">
(B  <interface>
(B    <langinfo xml:lang="ja"></langinfo>
(B    <decldata name="edittext" type="mtext"/>
(B    <declop name="convert">
(B      <dependency depend="edittext" affect="edittext">
(B    </declop>
(B    <declop name="fixate">
(B      <dependency depend="edittext" affect="edittext">
(B    </declop>
(B  </interface>
(B  <engine name="ja-romakana" class="com.sun.iiim.pce1.s1">
(B    <PCE>
(B      <deftable name="romakana" from="mtext" to="mtext">
(B	"a"        "$B$"(B"
(B	"i"        "$B$$(B"
(B	"u"        "$B$&(B"
(B	"e"        "$B$((B"
(B	"o"        "$B$*(B"
(B
(B	"xa"       "$B$!(B"
(B	"xi"       "$B$#(B"
(B	"xu"       "$B$%(B"
(B	"xe"       "$B$'(B"
(B	"xo"       "$B$)(B"
(B
(B	"ka"       "$B$+(B"
(B	"ki"       "$B$-(B"
(B	"ku"       "$B$/(B"
(B	"ke"       "$B$1(B"
(B	"ko"       "$B$3(B"
(B
(B	"kya"      "$B$-$c(B"
(B	"kyi"      "$B$-$#(B"
(B	"kyu"      "$B$-$e(B"
(B	"kye"      "$B$-$'(B"
(B	"kyo"      "$B$-$g(B"
(B
(B	"ga"       "$B$,(B"
(B	"gi"       "$B$.(B"
(B	"gu"       "$B$0(B"
(B	"ge"       "$B$2(B"
(B	"go"       "$B$4(B"
(B
(B	"gya"      "$B$.$c(B"
(B	"gyi"      "$B$.$#(B"
(B	"gyu"      "$B$.$e(B"
(B	"gye"      "$B$.$'(B"
(B	"gyo"      "$B$.$g(B"
(B
(B	"sa"       "$B$5(B"
(B	"si"       "$B$7(B"
(B	"su"       "$B$9(B"
(B	"se"       "$B$;(B"
(B	"so"       "$B$=(B"
(B
(B	"sha"      "$B$7$c(B"
(B	"shi"      "$B$7(B"
(B	"shu"      "$B$7$e(B"
(B	"she"      "$B$7$'(B"
(B	"sho"      "$B$7$g(B"
(B
(B	"sya"      "$B$7$c(B"
(B	"syi"      "$B$7$#(B"
(B	"syu"      "$B$7$e(B"
(B	"sye"      "$B$7$'(B"
(B	"syo"      "$B$7$g(B"
(B
(B	"za"       "$B$6(B"
(B	"zi"       "$B$8(B"
(B	"zu"       "$B$:(B"
(B	"ze"       "$B$<(B"
(B	"zo"       "$B$>(B"
(B
(B	"ja"       "$B$8$c(B"
(B	"ji"       "$B$8(B"
(B	"ju"       "$B$8$e(B"
(B	"je"       "$B$8$'(B"
(B	"jo"       "$B$8$g(B"
(B
(B	"zya"      "$B$8$c(B"
(B	"zyi"      "$B$8$#(B"
(B	"zyu"      "$B$8$e(B"
(B	"zye"      "$B$8$'(B"
(B	"zyo"      "$B$8$g(B"
(B
(B	"ta"       "$B$?(B"
(B	"ti"       "$B$A(B"
(B	"tu"       "$B$D(B"
(B	"te"       "$B$F(B"
(B	"to"       "$B$H(B"
(B
(B	"cha"      "$B$A$c(B"
(B	"chi"      "$B$A(B"
(B	"chu"      "$B$A$e(B"
(B	"che"      "$B$A$'(B"
(B	"cho"      "$B$A$g(B"
(B
(B	"tya"      "$B$A$c(B"
(B	"tyi"      "$B$A$#(B"
(B	"tyu"      "$B$A$e(B"
(B	"tye"      "$B$A$'(B"
(B	"tyo"      "$B$A$g(B"
(B
(B	"da"       "$B$ (B"
(B	"di"       "$B$B(B"
(B	"du"       "$B$E(B"
(B	"de"       "$B$G(B"
(B	"do"       "$B$I(B"
(B
(B	"dha"      "$B$G$c(B"
(B	"dhi"      "$B$G$#(B"
(B	"dhu"      "$B$G$e(B"
(B	"dhe"      "$B$G$'(B"
(B	"dho"      "$B$G$g(B"
(B
(B	"dya"      "$B$B$c(B"
(B	"dyi"      "$B$B$#(B"
(B	"dyu"      "$B$B$e(B"
(B	"dye"      "$B$B$'(B"
(B	"dyo"      "$B$B$g(B"
(B
(B	"na"       "$B$J(B"
(B	"ni"       "$B$K(B"
(B	"nu"       "$B$L(B"
(B	"ne"       "$B$M(B"
(B	"no"       "$B$N(B"
(B
(B	"nya"      "$B$K$c(B"
(B	"nyi"      "$B$K$#(B"
(B	"nyu"      "$B$K$e(B"
(B	"nye"      "$B$K$'(B"
(B	"nyo"      "$B$K$g(B"
(B
(B	"ha"       "$B$O(B"
(B	"hi"       "$B$R(B"
(B	"hu"       "$B$U(B"
(B	"he"       "$B$X(B"
(B	"ho"       "$B$[(B"
(B
(B	"fa"       "$B$U$!(B"
(B	"fi"       "$B$U$#(B"
(B	"fu"       "$B$U(B"
(B	"fe"       "$B$U$'(B"
(B	"fo"       "$B$U$)(B"
(B
(B	"hya"      "$B$R$c(B"
(B	"hyi"      "$B$R$#(B"
(B	"hyu"      "$B$R$e(B"
(B	"hye"      "$B$R$'(B"
(B	"hyo"      "$B$R$g(B"
(B
(B	"ba"       "$B$P(B"
(B	"bi"       "$B$S(B"
(B	"bu"       "$B$V(B"
(B	"be"       "$B$Y(B"
(B	"bo"       "$B$\(B"
(B
(B	"bya"      "$B$S$c(B"
(B	"byi"      "$B$S$#(B"
(B	"byu"      "$B$S$e(B"
(B	"bye"      "$B$S$'(B"
(B	"byo"      "$B$S$g(B"
(B
(B	"pa"       "$B$Q(B"
(B	"pi"       "$B$T(B"
(B	"pu"       "$B$W(B"
(B	"pe"       "$B$Z(B"
(B	"po"       "$B$](B"
(B
(B	"pya"      "$B$T$c(B"
(B	"pyi"      "$B$T$#(B"
(B	"pyu"      "$B$T$e(B"
(B	"pye"      "$B$T$'(B"
(B	"pyo"      "$B$T$g(B"
(B
(B	"ma"       "$B$^(B"
(B	"mi"       "$B$_(B"
(B	"mu"       "$B$`(B"
(B	"me"       "$B$a(B"
(B	"mo"       "$B$b(B"
(B
(B	"mya"      "$B$_$c(B"
(B	"myi"      "$B$_$#(B"
(B	"myu"      "$B$_$e(B"
(B	"mye"      "$B$_$'(B"
(B	"myo"      "$B$_$g(B"
(B
(B	"ya"       "$B$d(B"
(B	"yu"       "$B$f(B"
(B	"yo"       "$B$h(B"
(B
(B	"ra"       "$B$i(B"
(B	"ri"       "$B$j(B"
(B	"ru"       "$B$k(B"
(B	"re"       "$B$l(B"
(B	"ro"       "$B$m(B"
(B
(B	"rya"      "$B$j$c(B"
(B	"ryi"      "$B$j$#(B"
(B	"ryu"      "$B$j$e(B"
(B	"rye"      "$B$j$'(B"
(B	"ryo"      "$B$j$g(B"
(B
(B	"wa"       "$B$o(B"
(B	"wo"       "$B$r(B"
(B
(B	<!-- $B$s(B special rule -->
(B	"nb"       "$B$s(Bb"
(B	"nc"       "$B$s(Bc"
(B	"nd"       "$B$s(Bd"
(B	"nf"       "$B$s(Bf"
(B	"ng"       "$B$s(Bg"
(B	"nh"       "$B$s(Bh"
(B	"nj"       "$B$s(Bj"
(B	"nk"       "$B$s(Bk"
(B	"nl"       "$B$s(Bl"
(B	"nm"       "$B$s(Bm"
(B	"nn"       "$B$s(B"
(B	"np"       "$B$s(Bp"
(B	"nq"       "$B$s(Bq"
(B	"nr"       "$B$s(Br"
(B	"ns"       "$B$s(Bs"
(B	"nt"       "$B$s(Bt"
(B	"nv"       "$B$s(Bv"
(B	"nw"       "$B$s(Bw"
(B	"nx"       "$B$s(Bx"
(B	"ny"       "$B$s(By"
(B	"nz"       "$B$s(Bz"
(B	"n'"       "$B$s(B"
(B
(B      </deftable>
(B
(B      <defvar name="i" type="number"></defvar>
(B      <defvar name="kana" type="mtext"></defvar>
(B      <defvar name="sokuon" type="mtext"></defvar>
(B      <defun name="romatokana" type="bool" args="pos:number">
(B	<set v="kana"> nil </set>
(B	<set v="i"><sub> pos <tblkeymaxsize t="romakana"/></sub></set>
(B	<if><lt>i 0</lt><set v="i"> 0</set></if>
(B
(B	<while> <and> <not> kana </not> <lt> i pos </lt> </and>
(B	  <set v="kana">
(B	    <tblref t="romakana"><substr> kanaoutput i pos </substr></tblref>
(B	  </set>
(B	  <set v="i"><add>i 1</add></set>
(B	</while>
(B
(B	<if> kana
(B	  <set v="i"><sub>i 1</sub></set>
(B	  <!-- $B$C(B special rule -->
(B	  <if>
(B	    <and>
(B	      <gt>i 0</gt>
(B	      <ge><sub>pos i</sub>2</ge>
(B	      <eql>
(B		<UCSval><strref>kanaoutput i </strref></UCSval>
(B		<UCSval><strref>kanaoutput <sub>i 1</sub></strref></UCSval>
(B	      </eql>
(B	    </and>
(B	    <set v="sokuon"> "$B$C(B" </set>
(B	    <set v="i"><sub>i 1</sub></set>
(B	    <else>
(B	      <set v="sokuon"> "" </set>
(B	    </else>
(B	  </if>
(B
(B	  <set v="kanaoutput">
(B	    <concat>
(B	      <!-- head  -->
(B	      <substr> kanaoutput 0 i </substr>
(B	      sokuon
(B	      kana
(B	      <!-- tail  -->
(B	      <substr> kanaoutput pos </substr>
(B	    </concat>
(B	  </set>
(B	  <return> t </return>
(B	</if>
(B	<return> nil </return>
(B      </defun>
(B
(B      <defvar name="inputp" type="prop"> </defvar>
(B      <main>
(B	<!-- initialization. -->
(B	<if> <not> inputp </not>
(B	  <set v="inputp"><makeprop p="feedback"/></set>
(B	  <propadd>inputp 2</propadd>
(B	</if>
(B
(B	<label name="replay"/>
(B	<select>
(B	  <!-- return key always commit the uncomposed string. -->
(B	  <keycase code="10">
(B	    <commit> kanaoutput </commit>
(B	    <set v="kanaoutput">""</set>
(B	  </keycase>
(B	  <keycase char="&#xD;">
(B	    <commit> kanaoutput </commit>
(B	    <set v="kanaoutput">""</set>
(B	  </keycase>
(B	  <!-- space key convert the current string. -->
(B	  <keycase char=" ">
(B	    <interact op="convert"/>
(B	  </keycase>
(B	  <default>
(B	    <if> <evchar>curev</evchar>
(B	      <set v="kanaoutput"><concat> kanaoutput <evchar>curev</evchar></concat></set>
(B	      <e f="romatokana"> <strlen>kanaoutput</strlen> </e>
(B	      <setmprop>kanaoutput inputp 0 <strlen> kanaoutput </strlen></setmprop>
(B	      <else>
(B		<!-- I can't process this event -->
(B		<next> curev </next>
(B		<go to="replay"/>
(B	      </else>
(B	    </if>
(B	  </default>
(B	</select>
(B      </main>
(B    </PCE>
(B  </engine>
(B</ccdef>
(B-------------------------------------------------------------------------------


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]