1CANNALIB(3) Library Functions Manual CANNALIB(3)
2
3
4
6 CannaLib intro — Kana-to-Kanji Conversion Library Intro
7
9 Canna provides the following three libraries:
10
11 - High-level libraries
12
13 From application programs, high-level libraries are available with‐
14 out considering Kana-to-Kanji Conversion. Processes such as select‐
15 ing candidates (including candidate list display) are executed by
16 the Kana-to-Kanji Conversion system. Only fixed character strings
17 are passed to the application. If the Kana-to-Kanji Conversion
18 front end is being used for TTY input, the read (cooked mode) system
19 call in terminal input is regarded as a high-level library. In this
20 case, scanf, which uses it, is also regarded as a higo-level
21 library. The Japanese version of Athena Widget (Text Wideget) in
22 the X Window System is a more typical library that is regarded as a
23 high-level library.
24
25 - User interface libraries
26
27 Responding to one-character or one-key input, user interface
28 libraries return various kinds of information. They include the
29 unfixed character string, fixed character string, marked segment
30 position, status dispaly character string, and candidate list char‐
31 acter string. The libraries at this level do not provide the
32 detailed functions involving dictionary maintenance or learning con‐
33 trol. There is a little remaining room of divising the display
34 fields although rough lines for Japanese input user interface are
35 restricted. It is recommended that application interfaces at this
36 level be used for an application that desires to obtain keys in raw
37 mode in the TTY. Also, it is recommended that they be used for an
38 application that desires to input and display graphics and charac‐
39 ters in a single window.
40
41 - Dictionary access libraries
42
43 Dictionary access libraries are used to control dictionary access or
44 candidate selection directly. Kana-to-Kanji Conversion libraries at
45 this level provide various function interfaces. They include start‐
46 ing the use of Kana-to-Kanji Conversion system, converting the read‐
47 ing into Kanji, changing the splitting of sentence-segment, fetching
48 Next or Previous Candidate, controlling dictionary learning, and
49 maintaining dictionaries. Dictionary access libraries are used to
50 construct a user interface or high-level library. It is recommended
51 that they not be used by ordinary users.
52
53 Canna provides three header files and three libraries. Their outlines
54 are listed below:
55
56 - Header files
57
58 X11/kanji.h Used to input or output Japanese data with X.
59
60 canna/jrkanji.h Used to input or output TTY-level Japanese data.
61
62 canna/RK.h Used to use a dictionary access library.
63
64 - Libraries
65
66 libXnw Japanese version of Athena Widget Xaw. The appli‐
67 cation program does not need to consider Kana-to-
68 Kanji Conversion.
69
70 libXn Used to process Japanese data with X. When using
71 XLookupKanjiString or XDrawKanjiString, you must
72 link this library.
73
74 libcanna Kernel for Japanese data input
75
76 Library link and header file include must be done as follows, depending
77 on the function you use:
78
79 - Athena Widget
80
81 Header file canna/kanji.h
82
83 Library libXnw, libXn, libcanna
84
85 - XDrawKanjiString
86
87 Header file canna/kanji.h
88
89 Library libXn
90
91 - XLookupKanjiString, XKanjiControl
92
93 Header file canna/kanji.h
94
95 Library libXn, libcanna
96
97 - jrKanjiString, jrKanjiControl
98
99 Header file canna/jrkanji.h
100
101 Library libcanna
102
103 - Dictionary access library
104
105 Header file canna/RK.h
106
107 Library libcanna
108
110 Canna enables you to perform two or more Kana-to-Kanji Conversion pro‐
111 cesses simultaneously. Conversion contextsare used to control manage‐
112 ment of the respective Kana-to-Kanji Conversion processes. The inter‐
113 nal data needed for Kana-to-Kanji Conversion is secured in each con‐
114 text.
115
116 The application identifies each conversion context by the context num‐
117 ber. It is an integer equal to or larger than 0, and used as the first
118 parameter of any Kana-to-Kanji Conversion function.
119
120 Immediately after dictionary access library RkInitialize(3) initializes
121 Kana-to-Kanji Conversion, there is only the standard context, which has
122 the context number 0. It can be used by any application that uses only
123 one context.
124
126 Successive Segment Conversion analyzes the specified Hiragana string,
127 and splits it into a few elements called sentence segments, or Bun‐
128 setsu. An example of analysis is shown below:
129
130 ``KANAWOKANJINIHENKANSURU''
131 KANAWO KANAWO(1) KANAWO(2)
132 KANJINI KANJINI(1) KANJINI(2) KANJINI(3) KANJINI(4)
133 HENKANSURU HENKANSURU(1) HENKANSURU(2) HENKANSURU(3)
134
135
136 Each function provided by the dictionary access library's Successive
137 Segment Conversion may either modify the result of this analysis or
138 obtain the analysis information. It assumes a two-dimensional candi‐
139 date address.
140
141 Segment numbers 0, 1, ..., N-1 are assigned leftward to the N segments
142 that have been analyzed. The currently marked candidate is called the
143 current candidate.
144
145 For example, ``KANAWO'' may be specified as a candidate having Segment
146 Number 0 and Candidate Number 0. The library instead assumes current
147 segment and candidate in the context to simplify the parameters.
148
150 uilib(3) - User Interface Library
151
152 diclib(3) - Dictionary Access Library
153
154
155
156 CANNALIB(3)