Documentation  |   Table of Contents   |  < Previous   |  Next >   |  Index

1    Basic Concepts

Creating a Front-End Processor

Exploring Palm OS®

This chapter describes several concepts that will help you understand what a front-end processor is and how it is used.

This chapter discusses the following topics:

What Is a Front-End Processor? ^TOP^

A front-end processor (FEP), also known as an input method, is a facility that automatically converts phonetic or syllabic characters into ideographic or complex characters. With a front-end processor, you can use the Latin characters found on a standard keyboard to input syllables that are then converted to characters in the target language, such as the thousands of characters used in languages like Japanese, Chinese, and Korean.

For example, text input in Japanese requires software for translating Romaji (phonetic Japanese that uses Latin characters) or Hiragana (syllabic Japanese) into Kanji (ideographic Chinese characters) or Katakana (syllabic characters used mainly for foreign words). One Hiragana sequence may correspond to more than one Kanji character. The front-end processor must grammatically parse sentences or clauses of Hiragana text and select the best combination of Kanji, Hiragana, and Katakana characters to represent that text.

How Does a User Input Text? ^TOP^

Most front-end processors perform the character conversion within the current line of text, a method known as inline input. The field code passes events to the FEP, which then returns information about the appropriate text to display. Special characters, such as space or linefeed, are often used to initiate or confirm conversion.

In the Palm OS®, a front-end processor is known as a text service. The Text Services Manager provides functions that let forms, fields, and text services communicate about what happens in the active input field—the location in which the user enters text and where the text service (such as the front-end processor) tells the field what text to display.

How Is Inline Input Processed? ^TOP^

The front-end processor processes the user input, called raw text, as it is entered. The field code then draws the text on the screen as entered. The front-end processor then converts the raw text, translating it from phonetic or syllabic to a more complex representation. Finally, it confirms the converted text upon user approval of the conversion. The front-end processor continually tells the field code to remove the confirmed text from the beginning of the active input area.

An exception to this process occurs when a user taps outside the active input area or otherwise causes the field to lose the focus. In this case, the user has implicitly requested confirmation of the existing text.

How Does the FEP Handle Conversion? ^TOP^

The field code works with the FEP to support inline conversion. This is the only method of FEP-related text entry supported by Palm OS. There is no floating window or bottom-line input, as is provided by some other operating systems. Text that is part of the inline conversion process (that is, text in the active input area) is underlined by the field code.

Because a sequence of characters rarely has a one-to-one mapping with a single word or character in the FEP's conversion dictionary, the FEP's user interface can be extended. For example, in the Sample FEP, when a user writes an acronym that has more than one possible meaning, the user must choose the appropriate meaning. In the Palm OS Sample FEP, the user interface presents these options in a pop-up list.

What Is a FEP in the Palm OS? ^TOP^

In the Palm OS, FEPs are text service components that are implemented as shared libraries. These libraries can be created by any third-party developer or Palm OS licensee. FEPs must be implemented according to the FEP Shared Library API, which is described in Chapter 5, "Text Services FEP Reference."

Applications can control the FEP through the Text Services Manager API, which is described in Chapter 4, "Text Services Manager Reference." This API provides functions to get and set the current FEP mode, which is useful for explicitly disabling the FEP when a field shouldn't allow in-line conversion.

For More Information ^TOP^

Palm provides a sample FEP shared library to help you get started.