-/* Copyright (C) 2003, 2004, 2005, 2009
+/* Copyright (C) 2009
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H15PRO112
See the end for copying conditions. */
*/
/*
-Copyright (C) 2003, 2004, 2005, 2009
+Copyright (C) 2009
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H15PRO112
-/* Copyright (C) 2003, 2004, 2005, 2009
+/* Copyright (C) 2009
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H15PRO112
See the end for copying conditions. */
Basic terms in the m17n database are integers, strings, symbols,
lists, variable references and function calls. The schema file for
-Input Method or Font Layout Table may define other kind of terms.
+Input Method or Font Layout Table may extend these definitions or
+define other kind of terms.
Decimal character codes, hexadecimal character codes, and characters
represented with special syntax (a question mark followed by the
<varref vname="handled-keys">
#endif
-This code referes to the variable "handled-keys".
+This code refers to the variable "handled-keys".
@verbatim
<define name="defun">
@endverbatim
A <defmacro> element defines a macro whose name is specified
-with the "fname" attribute. Unlike <defmacro>, <args>
+with the "fname" attribute. Unlike <defun>, its arguments
must be already evaluated when the macro is called.
@verbatim
When a <defvar> specifies a value, it may have the
<possible-value> element that lists the possible values of the
variable. The type (one of integer, symbol, string) of the possible
-values must be same with that of the specifeid value.
+values must be same with that of the specified value.
When the type of the specified value is integer,
<possible-value> may have one or more <range> elements. A
The m17n database has some predefined functions, too.
In function definitions, arguments are often restricted to a certain
-type. For example, arithmetic operations would require integers, not
-strings. The following four elements are defined to represent such
-restrictions.
+type. For example, arithmetic operations would require integers, and
+would not accept strings. The following four elements are defined to
+represent such restrictions.
@verbatim
<define name="intterm" combine="choice">
<varref> appears as a <intterm>, its value must be an
integer and if a <funcall> appears as a <intterm>, it must
return an integer. The schema file for Input Method or Font Layout
-Table may define other kind of intterms.
+Table may define other kind of <intterm>.
@verbatim
<define name="strterm">
@endverbatim
A <strterm>, <symterm> or <listterm> is a term whose
-value is a string, a symbol or a list respecivelly. That is, if a
+value is a string, a symbol or a list respectively. That is, if a
<varref> appears as a <strterm>, its value must be an
string and if a <funcall> appears as a <symterm>, it must
return a symbol.
If the first term equals to the second term, the value of this funcall
is <integer>1</integer>. Otherwise,
-<integer>0</integer>. The equality of terms is defind as
+<integer>0</integer>. The equality of terms is defined as
below: An integer equals to another integer iff they contain the same
integer value. A string equals to another string iff they contain
strings of the same characters. A symbol equals to another symbol iff
same symbol. A list matches with another list iff the first list is
no longer than the second, and the Nth element of the first list
equals to the Nth element of the second list. An error matches with
-another error iif the first eroor's error type is <symbol/> or is the
+another error iff the first error's error type is <symbol/> or is the
same as the second error's error type.
@endverbatim
@endverbatim
These elements take two integer terms and compare them. The value of
-this funcall is <integer>1</integer> when when first
-integer is less than, less than or equal to, equal to, greater than or
-equal to, greater than, and not equal to the second value,
-respectivelly. Otherwise, <integer>0</integer>.
+this funcall is <integer>1</integer> when first integer is
+less than, less than or equal to, greater than or equal to, greater
+than the second value, respectively. Otherwise,
+<integer>0</integer>.
@verbatim
<element name="add">
When the attribute "vname" is given, this element calculates the
remaindar when the value of the variable "vname" is divided by the
given integer term, and the result becomes the value of the funcall.
-When the attribute is not given, this element calculates the remaindar
+When the attribute is not given, this element calculates the remainder
when the first integer term is divided by the second integer term.
@verbatim
@endverbatim
When the attribute "vname" is given, these elements perform "logical
-and", "logcal inclusive or", or "logical exclusive or" of the value of
-the variable "vname" and the given integer term(s). The result
+and", "logical inclusive or", or "logical exclusive or" of the value of
+the variable "vname" and the given integer term(s), respectively. The result
becomes the value of the funcall. When the attribute is not given,
-these elements perform "logical and", "logcal inclusive or", or
+these elements perform "logical and", "logical inclusive or", or
"logical exclusive or" of the given integer term(s).
@verbatim
</element>
@endverbatim
-When the attribute "vname" is given, its value must be a list and that
-list is modified destructively by concatinating all the elements of
-the given terms if it is a list, or the element itself if not, in the
-specified order. When no attribute is given, a list is made by
-concatinating all the given terms in the same manner. The resulting
-list becomes the value of the funcall.
+When the attribute "vname" is given, the value of the variable "vname"
+must be a list. This element modifies the list destructively by
+concatenating all the elements of the given terms if it is a list, or
+the term itself if not, in the specified order. When no attribute is
+given, a list is made by concatenating all the given terms in the same
+manner. The resulting list becomes the value of the funcall.
@verbatim
<element name="concat">
@endverbatim
When the attribute "vname" is given, its value must be a string and
-that string is modified destructively by concatinating all the given
+that string is modified destructively by concatenating all the given
term(s). If a term is a string term, the string is to be
concatinated. If a term is a integer term, a string of a character
whose code is its integer value is to be concatinated. If If a term
-is a list term, its elements must be interger terms and a string
-containing characters whose codes are their integer values is to be
+is a list term, its elements must be interger terms, and a string
+containing characters whose codes are the integer values is to be
concatinated.
When no attribute is given, a string is made by concatinating all the
<progn><shift><symbol>state-init</symbol></shift></progn>
</if>
#endif
-This code performs the <shift> action if the variable @c C is negative.
+This code performs the <shift> if the variable @c C is negative.
@verbatim
<element name="when"><oneOrMore><ref name="term"/></oneOrMore></element>
<element name="cond"><oneOrMore><ref name="list"/></oneOrMore></element>
@endverbatim
-This <cond> evaluates the first element of the given lists, one
+This element evaluates the first element of the given lists, one
by one, and and when it finds the first list whose first element is
evaluated to be true, other elements in the list are evaluated.
</cond>
#endif
-This code sets the varialbe "ret" to the integer value 1 when the
+This code sets the variable "ret" to the integer value 1 when the
variable "level" has value 0, otherwise, calls "macro-cp12".
@verbatim
@endverbatim
This element evaluate the first term and if true, evaluate the rest.
-This processs repeats until the first term becomes not true.
+This process repeats until the first term becomes not true.
@verbatim
<element name="foreach"><attribute name="vname"/>
@endverbatim
This element repeatedly evaluate terms for each element of the string
-or list term. The attribute "vname" specifies the varialve that the
+or list term. The attribute "vname" specifies the variable that the
current element is assigned to, on each loop.
@verbatim
</element>
@endverbatim
-Thie element evalustes the given terms one by one, until a term
+This element evaluates the given terms one by one, until a term
matching with the specified symbol or error is thrown by
>throw/<. If such an item is thrown, the value of this element
is >integer<1>/integer<, otherwise
</element>
@endverbatim
-This element throws to the catch for the specified symbol or eroor.
+This element throws to the catch for the specified symbol or error.
The value of this element is the term (if any) or the symbol, or the
error.
</define>
@endverbatim
-This element shows the type of the given term. The type is
-one of the followings: <symbol>integer</symbol>, <symbol>string</symbol>,
-<symbol>symbol</symbol>, <symbol>list</symbol>, <symbol>error</symbol>.
+This element shows the type of the given term. The type is one of the
+followings: <symbol>integer</symbol>,
+<symbol>string</symbol>,
+<symbol>symbol</symbol>,
+<symbol>list</symbol>, <symbol>error</symbol>
+
+@section im-seealso SEE ALSO
+@ref mdbGeneral "mdbGeneral(5)"
+*/
+
+/*
+Copyright (C) 2009
+ National Institute of Advanced Industrial Science and Technology (AIST)
+ Registration Number H15PRO112
+
+This file is part of the m17n database; a sub-part of the m17n
+library.
+
+The m17n library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public License
+as published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+The m17n library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+You should have received a copy of the GNU Lesser General Public
+License along with the m17n library; if not, write to the Free
+Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.
+*/
+/* Local Variables: */
+/* coding: utf-8 */
+/* End: */
Registration Number H15PRO112
See the end for copying conditions. */
-/***en
+/***ja
@page mdbIM インプットメソッド
@section im-format 文法と意味
-以下に RelaxNG で書かれた入力メソッド定義用スキーマを示す。(このスキー
-マファイルは m17n-db-xml/MIMNEW/mimnew.rng にあり、
-基本的な表現や項を定義する m17n-db-xml/MIMNEW/mimnew.rng も利用する。)
+以下に RelaxNG で書かれた入力メソッド定義用スキーマを示す。(このファイ
+ルは m17n-db-xml/MIMNEW/mimnew.rng にある。またこのスキーマは、基本的な
+表現や項を定義する m17n-db-xml/MIMNEW/expr.rng を継承して利用する。)
@verbatim
*/
/*
-Copyright (C) 2003, 2004, 2005
+Copyright (C) 2003, 2004, 2005, 2009
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H15PRO112
</variable-list>
#endif
+This code declares a variable "precomposed" whose possible values are
+integer 0 or 1 and the default value is 0.
+
@verbatim
<define name="command-list">
<element name="command-list">
Like <variable-list>, the declaration can be used in two ways.
One is to introduce a new command. In that case, the <keyseq>
-element must appear in <command>. Another is to inherit the
+element must appear in <defcmd>. Another is to inherit the
command from what declared in "global.mimx", and to give the different
key binding and/or to make the command customizable specially for the
current input method. In the latter case, <keyseq> can be
</oneOrMore>
</element>
</define>
-@endbatim
+@endverbatim
Each <module> element declares an external module (i.e. dynamic
library). The value of "id" attribute gives the name of the module.
The name of the module, "-function-" and the name of the function
itself consitute the value of the "fname" attribute. If the "fname"
attribute has the value that ends with "init", it is called with only
-the default arguments (see <call>) when an input context is
-created for the input method. If it has the value that ends with
-"fini", it is called with only the default arguments when the input
-context is destroyed.
+the default arguments when an input context is created for the input
+method. If it has the value that ends with "fini", it is called with
+only the default arguments when the input context is destroyed.
#if EXAMPLE_CODE
<module-list>
This code calls the function 'resize' of the module 'libmimx-anthy'
with a symbol argument whose value is "t".
-
+@verbatim
<define name="macro-list">
<element name="macro-list">
<oneOrMore>
</oneOrMore>
</element>
</define>
+@endbatim
<macro-list> declares macros used in this input method. Details
of <defun> can be found in @ref expr.
@subsection im-terms Input Method Terms
-The m17n database has special tags and terms for wrinting input
-methods: markers, selectors and key sequences.
+The m17n database has special terms for wrinting input methods:
+markers, selectors and key sequences.
@verbatim
<define name="term" combine="choice">
</define>
@endverbatim
-These terms can be used in functions defined in expr.rng.
+These terms can be used in functions defined in mimnew.rng.
@verbatim
<define name="marker">
Some markers that starts with @@ have special meanings. @@0, @@1,
... , @@9 mark the 0th, 1st, ... , 9th position in the preedit buffer
respectively. @@<, @@=, @@>, @@- and @@+ mark the first,
-current, last, previous and next position in the preediting buffer
-respectively. @@[ marks the previous position where a candidate list
+current, last, preceding and following position in the preediting buffer
+respectively. @@[ marks the preceding position where a candidate list
changes. @@] marks the next position where a candidate list changes.
@@+N and @@-N (N is an positive integer) mark the N-th preceding or
contain Latin-1 characters.
The element in the <listterm> in the <keyseq> must be
-either an intterm whose value is a valid character code, or a symterm
-whose value is the return value of the minput_event_to_key ()
-function. Under the X window system, you can quickly check the value
-using the @c xev command. For example, the return key, the backspace
-key, and the 0 key on the keypad are represented as @c Return, @c
-BackSpace, @c KP_0 respectively. If the shift, control, meta, alt,
-super, and hyper modifiers are used, they are represented by the S- ,
-C- , M- , A- , s-, and H- prefixes respectively in this order. Thus,
-"return with shift with meta with hyper" is @c S-M-H-Return. Note
-that "a with shift" .. "z with shift" are represented simply as A
-.. Z. Thus "a with shift with meta with hyper" is @c M-H-A.
+either an <intterm> whose value is a valid character code, or a
+<symterm> whose value is the return value of the
+minput_event_to_key () function. Under the X window system, you can
+quickly check the value using the @c xev command. For example, the
+return key, the backspace key, and the 0 key on the keypad are
+represented as @c Return, @c BackSpace, @c KP_0 respectively. If the
+shift, control, meta, alt, super, and hyper modifiers are used, they
+are represented by the S- , C- , M- , A- , s-, and H- prefixes
+respectively in this order. Thus, "return with shift with meta with
+hyper" is @c S-M-H-Return. Note that "a with shift" .. "z with shift"
+are represented simply as A .. Z. Thus "a with shift with meta with
+hyper" is @c M-H-A.
#if EXAMPLE_CODE
This code calls the command "command-start".
-@subsection imfuncalls Input Method Function Calls
+@subsection imfuncalls Input Method Functions
In addion to those defined in expr.rng, the m17n database prepares
several functions for writing input methods.
The element <insert> inserts a character or a M-text before the
current position.
-When its content is a strterm, its value is the M-text to be inserted.
-When an intterm is given, its value is the code of a character to be
+When its content is a <strterm>, its value is the M-text to be inserted.
+When an <intterm> is given, its value is the code of a character to be
inserted.
The marker positions affected by the insertion are
automatically relocated.
The element <insert-candidates> specifies characters or strings
to be possibly inserted before the current position.
-When a listterm is glven, each item in this list is a candidate string
-to be inserted. When a strterm is given, each character in the string
-is a candidate character to be inserted. <insert> inserts the
-first candidate before the current position. The inserted character
-or string is associated with the list of candidates and the
-information indicating the currently selected candidate.
+When a <listterm> is glven, each item in this list is a
+candidate string to be inserted. When a <strterm> is given,
+each character in the string is a candidate character to be inserted.
+<insert-candidates> inserts the first candidate before the current
+position. The inserted character or string is associated with the
+list of candidates and the information indicating the currently
+selected candidate.
#if EXAMPLE_CODE
<element name="delete"><choice><ref name="markerterm"/><ref name="intterm"/></choice></element>
@endverbatim
-When a markerterm is given, this element deletes characters between
+When a <markerterm> is given, this element deletes characters between
the current position and the specified marker position.
#if EXAMPLE_CODE
#endif
This code deletes the character between the current position and the
-previous position.
+preceding position.
-When a intterm is given, the element <delete> treats it as a
+When a <intterm> is given, the element <delete> treats it as a
character position, and deletes characters between the current
position and the character position.
<element name="select"><choice><ref name="selectorterm"/><ref name="intterm"/></choice></element>
@endverbatim
-The element <select> first checks if the character just before
-the current position belongs to a string that is associated with a
+The element <select> first checks if the string just before the
+current position belongs to a string that is associated with a
candidate list. If so, it replaces that string with a candidate
-specified by the selectorterm or the intterm. If a intterm is given,
-it specifies a position in the candidate list.
+specified by the <selectorterm> or the <intterm>. If a
+<intterm> is given, it specifies a position in the candidate
+list.
#if EXAMPLE_CODE
<select><selector>@first</selector></select>
@endverbatim
The element <move> moves the current position. When a
-markerterm is given, the current position is moved to the position of
-the marker. When an intterm is given, its value is a character
+<markerterm> is given, the current position is moved to the position of
+the marker. When an <intterm> is given, its value is a character
position and the current position is moved to the character postion.
#if EXAMPLE_CODE
@endverbatim
The element <pushback> pushes back key events to the event
-queue. When a keyseqterm is given, it pushes back specified keys. An
-intterm given to this element must not be negative. If it is zero,
+queue. When a <keyseqterm> is given, it pushes back specified keys. An
+<intterm> given to this element must not be negative. If it is zero,
all key events are pushed back. If it is a positive integer N, the
latest N key events are pushed back.
@endverbatim
The element <shift> shifts the current state (See @ref imstate.)
-to the one specified by the value of the given symterm". The value
+to the one specified by the value of the given <symterm>. The value
must appear in <state-list>. The element <shiftback>
shifts the current state to the previous one.
@endverbatim
The element <char-at> returns the integer value
-<integer>C</integer>, where C is the character in the preedit text or
-the surrounding text at the postion specified by the given markerterm.
+<integer>C</integer>, where C is the character in the preedit text or
+the surrounding text at the postion specified by the given <markerterm>.
@verbatim
<element name="key-count"><empty/></element>
</define>
@endverbatim
-The element <surrounding-text-flag> returns <integer>1</integer>
-if surrounding text handling is supported or <integer>0</integer> if
-not.
+<surrounding-text-flag> returns <integer>1</integer>
+if surrounding text handling is supported or
+<integer>0</integer> if not.
+
@subsection imstate Input Method States and Transitions
<state-list>.
Each <state> has zero or more <branch>es. Each
-<branch> corresponds to a <map> in a <map-list>.
-The value of the attribute "mname" specifies a <map>'s "mname"
-value. When the input sequence matches one of the <keyseq> (or
+<branch> corresponds to a <map> in a <map-list>
+whose "mname" value is the same with the branch's "mname" value. When
+the input sequence matches one of the <keyseq> (or
<command-reference>) of a <rule> of the <map>, the
-corresponding <branch> is selected, <funcall>s in the
-<rule> are executed, <funcall>s specified in that
-<branch> are executed, and the input method driver shifts to the
+corresponding <branch> is selected. The input method driver
+first executes <funcall>s in the <rule>, then
+<funcall>s specified in that <branch>, and shifts to the
initial condition of the current state.
Whenever the input method driver shifts to the initial condition of
This code defines state transitions in an input method. It has two
states "state-init" and "state-second". The state "state-init" has
-two <branchglt;s: "map-consonant" and "map-independent". When an
-input sequence belonging to "map-consonant" is given, the state is
-shifted to "state-second", after executing <funcall>s in the
-<rule> for the input sequence. The state "state-second" has
-three branches, two of which shift the state back to the "state-init".
+two <branchglt;s corresponding to "map-consonant" and
+"map-independent". When an input sequence belonging to
+"map-consonant" is given, the state is shifted to "state-second",
+after executing <funcall>s in the <rule> for the input
+sequence. The state "state-second" has three branches, two of which
+shift the state back to the "state-init".
@verbatim
</grammar>
<optional>
<element name="description">
<choice>
- <text/>
<element name="get-text"><text/></element>
+ <text/>
</choice>
</element>
</optional>
<define name="saction">
<choice>
<element name="shift-to">
- <attribute name="id"><data type="IDREF"/>
- </attribute>
+ <attribute name="id"><data type="IDREF"><param name="pattern">state-.*</param></data></attribute>
</element>
<element name="shift-back"><empty/></element>
<ref name="action"/>