入力メソッド定義用の RelaxNG スキーマは、</grammar> で終わる。
-@ifnot FOR-MAN
-
-@section im-example1 EXAMPLE 1
-
-This is a very simple example for inputting Latin characters with
-diacritical marks (acute and cedilla). For instance, when you type:
-@verbatim
- Comme'die-Franc,aise, chic,,
-@endverbatim
-you will get this:
-@if FOR-HTML
-@verbatim
- Commédie-Française, chic,
-@endverbatim
-@endif
-@if FOR-LATEX
-@latexonly
-\hskip5mm\texttt{\footnotesize Comm\'{e}die-Fran\c{c}aise, chic,}
-@endlatexonly
-@endif
-
-The definition of the input method is very simple as below, and it is
-quite straight forward to extend it to cover all Latin characters.
-
-@verbatim
-<?xml version='1.0'?>
-<input-method xmlns="http://www.m17n.org/MIM">
- <tags>
- <language>t</language>
- <name>latn-post</name>
- </tags>
- <title>latin-postfix</title>
- <map-list>
- <map id="map-trans">
- <rule><keyseq keys="A'"/><insert string="Á"/></rule>
- <rule><keyseq keys="a'"/><insert string="á"/></rule>
- <rule><keyseq keys="A''"/><insert string="A'"/></rule>
- <rule><keyseq keys="a''"/><insert string="a'"/></rule>
- <rule><keyseq keys="C,"/><insert string="Ç"/></rule>
- <rule><keyseq keys="c,"/><insert string="ç"/></rule>
- <rule><keyseq keys="C,,"/><insert string="C,"/></rule>
- <rule><keyseq keys="c,,"/><insert string="c,"/></rule>
- <rule><keyseq keys="E'"/><insert string="É"/></rule>
- <rule><keyseq keys="e'"/><insert string="é"/></rule>
- <rule><keyseq keys="E''"/><insert string="E'"/></rule>
- <rule><keyseq keys="e''"/><insert string="e'"/></rule>
- <rule><keyseq keys="I'"/><insert string="Í"/></rule>
- <rule><keyseq keys="i'"/><insert string="í"/></rule>
- <rule><keyseq keys="I''"/><insert string="I'"/></rule>
- <rule><keyseq keys="i''"/><insert string="i'"/></rule>
- <rule><keyseq keys="O'"/><insert string="Ó"/></rule>
- <rule><keyseq keys="o'"/><insert string="ó"/></rule>
- <rule><keyseq keys="O''"/><insert string="O'"/></rule>
- <rule><keyseq keys="o''"/><insert string="o'"/></rule>
- <rule><keyseq keys="U'"/><insert string="Ú"/></rule>
- <rule><keyseq keys="u'"/><insert string="ú"/></rule>
- <rule><keyseq keys="U''"/><insert string="U'"/></rule>
- <rule><keyseq keys="u''"/><insert string="u'"/></rule>
- </map>
- </map-list>
- <state-list>
- <state id="state-init">
- <branch branch-selecting-map="map-trans"/>
- </state>
- </state-list>
-</input-method>
-@endverbatim
-
-
-@section im-example2 EXAMPLE 2
-
-This example is for inputting Unicode characters by typing C-u
-(Control-u) followed by four hexadecimal digits. For instance, when
-you type ("^u" means Control-u):
-@verbatim
- ^u2190^u2191^u2192^u2193
-@endverbatim
-you will get this (Unicode arrow symbols):
-@if FOR-LATEX
-@verbatim
- $\leftarrow \uparrow \rightarrow \downarrow
-@endverbatim
-@endif
-@if FOR-HTML
-@verbatim
- ←↑→↓
-@endverbatim
-@endif
-
-The definition utilizes <set> and <conditional> as below:
-@verbatim
-<?xml version='1.0'?>
-<input-method xmlns="http://www.m17n.org/MIM">
- <tags>
- <language>t</language>
- <name>unicode</name>
- </tags>
- <title>UNICODE</title>
- <map-list>
- <map id="map-starter">
- <rule><keyseq><key-event>C-U</key-event></keyseq><insert string="U+"/></rule>
- </map>
- <map id="map-hex">
- <rule><keyseq keys="0"/><insert string="0"/></rule>
- <rule><keyseq keys="1"/><insert string="1"/></rule>
- : :
- <rule><keyseq keys="9"/><insert string="9"/></rule>
- <rule><keyseq keys="A"/><insert string="A"/></rule>
- <rule><keyseq keys="B"/><insert string="B"/></rule>
- : :
- <rule><keyseq keys="f"/><insert string="F"/></rule>
- </map>
- </map-list>
- <state-list>
- <state id="state-init">
- <branch branch-selecting-map="map-starter">
- <set id="code"><int-val>0</int-val></set>
- <set id="count"><int-val>0</int-val></set>
- <shift-to id="state-uni-hex"/>
- </branch>
- </state>
- <state id="state-uni-hex">
- <branch branch-selecting-map="map-hex">
- <set id="this"><predefined-nth-previous-or-following-character position="-1"/></set>
- <conditional>
- <case>
- <expr operator="<">
- <predefined-nth-previous-or-following-character position="-1"/>
- <int-val>65</int-val> <!-- ?A -->
- </expr>
- <sub id="this"><int-val>48</int-val></sub>
- </case>
- <case>
- <int-val>1</int-val>
- <sub id="this"><int-val>55</int-val></sub>
- </case>
- </conditional>
- <set id="code">
- <expr operator="+">
- <expr operator="*">
- <variable-reference id="code"/>
- <int-val>16</int-val>
- </expr>
- <variable-reference id="this"/>
- </expr>
- </set>
- <set id="count">
- <expr operator="+">
- <variable-reference id="count"/>
- <int-val>1</int-val>
- </expr>
- </set>
- <conditional>
- <case>
- <expr operator="=">
- <variable-reference id="count"/>
- <int-val>4</int-val>
- </expr>
- <delete-to-marker position="@first"/>
- <insert character-or-string="variable">
- <variable-reference id="code"/>
- </insert>
- <shift-to id="state-init"/>
- </case>
- </conditional>
- </branch>
- </state>
- </state-list>
-</input-method>
-
-@endverbatim
-
-@section im-example3 EXAMPLE 3
-
-This example is for inputting Chinese characters by typing PinYin key
-sequence.
-@if FOR-HTML
-For instance, when you type:
-@verbatim
- nihaobei2jing2
-@endverbatim
-you will get:
-@verbatim
- 你好北京
-@endverbatim
-
-The definition utilizes <candidate> and <select> as below.
-Note that this is just an example, and it ignores such important key
-as Backspace.
-
-@verbatim
-<input-method> <tags>..</tags>
-<title>"拼"</title>
-
-<map-list>
- <map id="map-starter">
-<!-- The initial character of Pinyin.-->
- <rule><keyseq keys="a"/></rule>
- <rule><keyseq keys="b"/></rule>
- : :
- <rule><keyseq keys="z"/></rule>
- </map>
- <map id="map-pinyon">
-<!-- Big table of Pinyin vs the corresponding Chinese characters.-->
- <rule><keyseq keys="bei"/>
- <insert><candidates>被北备背悲辈杯倍贝碑... </candidates>...</insert></rule>
- <rule><keyseq keys="hao"/>
- <insert><candidates>好号毫豪浩耗皓嚎昊郝... </candidates>...</insert></rule>
- <rule><keyseq keys="jing"/>
- <insert><candidates>经京精境警竟静惊景敬... </candidates>...</insert></rule>
- <rule><keyseq keys="ni"/>
- <insert><candidates>你呢尼泥逆倪匿拟腻妮... </candidates>...</insert></rule>
- </map>
- <map id="map-choose">
-<!-- Typing 1, 2, ..., 0 selects the 0th, 1st, ..., 9th candidate.-->
- <rule><keyseq keys="1"/><select index="0"/></rule>
- <rule><keyseq keys="2"/><select index="1"/></rule>
- : :
- <rule><keyseq keys="9"/><select index="8"/></rule>
- <rule><keyseq keys="0"/><select index="9"/></rule>
- </map>
-</map-list>
-
-<state-list>
- <state id="state-init">
-<!-- When an initial character of Pinyin is typed, re-handle it in
- "state-main" state. Anything else is just produced as is. -->
- <branch branch-selecting-map="map-starter">
- <show-candidates/>
- <pushback-n-events n="1"/>
- <shift-to id="state-main"/>
- </branch>
- </state>
-
- <state id="state-main">
-<!-- When a complete Pinyin sequence is typed, shift to "state-select" state
- to allow users to select one from the candidates. -->
- <branch branch-selecting-map="map-pinyin">
- <shift-to id="state-select"/>
- </branch>
-<!-- When anything else is typed, produce the current candidate (if
- any), and re-handle the last input in "state-init" state. -->
- <catch-all-branch>
- <hide-candidates/>
- <shift-to id="state-init"/>
- </catch-all-branch>
- </state>
-
- <state id="state-select">
-<!-- When a number is typed, select the corresponding canidate,
- produce it, and shift to "init" state. -->
- <branch branch-selectiong-map="map-choose">
- <hide-candidates/>
- <shift-to id="state-init"/>
- </branch>
-
-<!-- When anything else is typed, produce the current candidate,
- and re-handle the last input in "init" state. -->
- <catch-all-branch>
- <hide-candidates/>
- <shift-to id="state-init"/>
- </catch-all-branch>
- </state>
- </state-list>
-</input-method>
-
-@endverbatim
-
-@elseif FOR-LATEX
-@latexonly
-\begin{center}
-\fbox{This example is readable only in the documentation of HTML version.}
-\end{center}
-@endlatexonly
-@endif
-
-@endif
-
@section im-seealso SEE ALSO
@ref mim-list "Input Methods provided by the m17n database",