CANNALIB(3)
β¨ CANNALIB β¨
okay bestie, sit down, hydrate, because this is the intro page for CannaLib, aka the Kana-to-Kanji Conversion Library, and it's lowkey the gateway drug to every other Canna page. π
πΈ NAME πΈ
CannaLib_intro β Kana-to-Kanji Conversion Library Intro
That's it, that's the name, iconic behavior honestly. π
π¦ DESCRIPTION π¦
Canna hands you three libraries, and they go from "girl I don't even wanna think about it" to "yeah you're gonna have to think about it":
- High-level libraries β from application programs, these are available without considering Kana-to-Kanji Conversion at all. Processes like selecting candidates (including the candidate list display) are executed by the Kana-to-Kanji Conversion system itself. Only fixed character strings get passed to the application. If the Kana-to-Kanji Conversion front end is being used for TTY input, the
read(cooked mode) system call in terminal input counts as a high-level library. In that case,scanf, which uses it, also counts as a high-level library. The Japanese version of Athena Widget (Text Widget) in the X Window System is a more typical library that counts as a high-level library. π«Ά - User interface libraries β responding to one-character or one-key input, these return all kinds of info: the unfixed character string, the fixed character string, the marked segment position, the status display character string, and the candidate list character string. The libraries at this level do not provide the detailed functions involving dictionary maintenance or learning control. There's a little remaining room for devising the display fields, although the rough lines for a Japanese input user interface are restricted. It's recommended that application interfaces at this level be used for an application that wants to grab keys in raw mode in the TTY. Also, it's recommended that they be used for an application that wants to input and display graphics and characters in a single window. β¨
- Dictionary access libraries β these are used to control dictionary access or candidate selection directly. The Kana-to-Kanji Conversion libraries at this level provide various function interfaces, and they include: starting the use of the Kana-to-Kanji Conversion system, converting the reading into Kanji, changing the splitting of sentence-segment, fetching Next or Previous Candidate, controlling dictionary learning, and maintaining dictionaries. Dictionary access libraries are used to construct a user interface or a high-level library. It is recommended that ordinary users not use them. π«
fr fr, if you're just a normal person trying to type Japanese, stay in your lane on the top two levels. the third one is for the builders.
Canna provides three header files and three libraries. Their outlines are listed below:
- Header files
X11/kanji.hβ used to input or output Japanese data with X.canna/jrkanji.hβ used to input or output TTY-level Japanese data.canna/RK.hβ used to use a dictionary access library.
- Libraries
libXnwβ the Japanese version of Athena WidgetXaw. The application program does not need to consider Kana-to-Kanji Conversion.libXnβ used to process Japanese data with X. When usingXLookupKanjiStringorXDrawKanjiString, you must link this library.libcannaβ kernel for Japanese data input.
Library link and header file include must be done as follows, depending on the function you use:
- Athena Widget
- Header file:
canna/kanji.h - Library:
libXnw,libXn,libcanna
- Header file:
XDrawKanjiString- Header file:
canna/kanji.h - Library:
libXn
- Header file:
XLookupKanjiString,XKanjiControl- Header file:
canna/kanji.h - Library:
libXn,libcanna
- Header file:
jrKanjiString,jrKanjiControl- Header file:
canna/jrkanji.h - Library:
libcanna
- Header file:
- Dictionary access library
- Header file:
canna/RK.h - Library:
libcanna
- Header file:
π Conversion context π
Canna lets you run two or more Kana-to-Kanji Conversion processes at the same time. Conversion contexts are what control the management of each of those respective Kana-to-Kanji Conversion processes. The internal data needed for Kana-to-Kanji Conversion is secured in each context.
The application identifies each conversion context by the context number. It's an integer equal to or larger than 0, and it's used as the first parameter of any Kana-to-Kanji Conversion function. π
Immediately after the dictionary access library RkInitialize(3) initializes Kana-to-Kanji Conversion, there is only the standard context, which has the context number 0. It can be used by any application that uses only one context.
π Outline of Successive Segment Conversion: π
Successive Segment Conversion analyzes the specified Hiragana string, and splits it into a few elements called sentence segments, or Bunsetsu. An example of analysis is shown below:
``KANAWOKANJINIHENKANSURU''
KANAWO KANAWO(1) KANAWO(2)
KANJINI KANJINI(1) KANJINI(2) KANJINI(3) KANJINI(4)
HENKANSURU HENKANSURU(1) HENKANSURU(2) HENKANSURU(3)
Each function provided by the dictionary access library's Successive Segment Conversion may either modify the result of this analysis or obtain the analysis information. It assumes a two-dimensional candidate address.
Segment numbers 0, 1, ..., N-1 are assigned leftward to the N segments that have been analyzed. The currently marked candidate is called the current candidate.
For example, KANAWO may be specified as a candidate having Segment Number 0 and Candidate Number 0. The library instead assumes current segment and candidate in the context to simplify the parameters. π
π SEE ALSO π
uilib(3)β User Interface Librarydiclib(3)β Dictionary Access Library
and that's the whole page, bestie π this was CANNALIB(3), page CannaLib_intro from the Library Functions Manual β go forth and convert your kana, you absolute main character π¦πΈβ
π¦ where this page comes from
- debian bookworm: libcanna1g-dev 3.7p3-20 Β· ISC
- debian trixie: libcanna1g-dev 3.7p3-25 Β· ISC
- ubuntu jammy: libcanna1g-dev 3.7p3-17 Β· ISC
- ubuntu noble: libcanna1g-dev 3.7p3-20 Β· ISC
- ubuntu questing: libcanna1g-dev 3.7p3-26
- ubuntu resolute: libcanna1g-dev 3.7p3-26build1 Β· ISC
- ubuntu stonking: libcanna1g-dev 3.7p3-29 Β· ISC
- Copyright 1994 NEC Corporation, Tokyo, Japan
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms