FOray

FOray Users
Module Users
Developers
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

FOray Modules: FOrayHyphen

Contents

Introduction

FOrayHyphen is an implementation of axslHyphen, which should be consulted for details on the general API, sample code, etc. Although it is possible to use the FOrayHyphen package directly, there is probably no good reason to do so. If the axslHyphen interface is not sufficient for your needs, we recommend that you suggest changes to it instead of using the FOrayHyphen package directly. This allows your application to use any aXSL-compliant hyphenation system without making substantial changes to your code.

Bootstrapping FOrayHyphen

The FOray-specific tasks that are needed to bootstrap the use of FOrayHyphen are as follows:

  1. Obtain a FOrayHyphenationServer instance. FOrayHyphenationServer is an aXSL HyphenationServer implementation, and can be instantiated using its constructor. It is safe to create multiple instances, but this should be necessary only in extremely sophisticated environments.

Once these tasks are accomplished, all downstream processing is documented in the axslHyphen API. In general, this consists of using passing a word, language, and country code to the HyphenationServer, and receiving a Hyphenation instance back, which contains the valid hyphenation points.

Here is some sample bootstrap code:

/* Instantiate a FOray HyphenationServer. */
Log logger = org.foray.common.Logging.makeDefaultLogger();
URL patternsURL = ...;
HyphenationServer server = new FOrayHyphenationServer(logger, patternsURL);