#include <hyphenator.hh>
dw::Hyphenator::Hyphenator |
( |
const char * |
patFile, |
|
|
const char * |
excFile, |
|
|
int |
pack = 256 |
|
) |
| |
dw::Hyphenator::~Hyphenator |
( |
| ) |
|
Hyphenator * dw::Hyphenator::getHyphenator |
( |
const char * |
language | ) |
|
|
static |
Hyphenate a single word, which only consists of lowercase characters. Store break positions + "offset" in "breakPos".
References lout::misc::SimpleVector< T >::get(), lout::container::typed::Vector< T >::get(), lout::object::Integer::getValue(), lout::misc::SimpleVector< T >::increase(), lout::misc::max(), lout::misc::min(), lout::unicode::nextUtf8Char(), lout::unicode::numUtf8Chars(), lout::misc::SimpleVector< T >::set(), lout::misc::SimpleVector< T >::setSize(), lout::misc::SimpleVector< T >::size(), and lout::container::typed::Collection< T >::size().
int * dw::Hyphenator::hyphenateWord |
( |
core::Platform * |
platform, |
|
|
const char * |
word, |
|
|
int * |
numBreaks |
|
) |
| |
void dw::Hyphenator::insertException |
( |
char * |
s | ) |
|
|
private |
void dw::Hyphenator::insertPattern |
( |
TrieBuilder * |
trieBuilder, |
|
|
char * |
s |
|
) |
| |
|
private |
bool dw::Hyphenator::isCharPartOfActualWord |
( |
char * |
s | ) |
|
|
private |
Test whether the character on which "s" points (UTF-8) is an actual part of the word. Other characters at the beginning and end are ignored.
TODO Currently only suitable for English and German. TODO Only lowercase. (Uppercase not needed.)
References lout::unicode::decodeUtf8(), and lout::unicode::isAlpha().
bool dw::Hyphenator::isHyphenationCandidate |
( |
const char * |
word | ) |
|
|
static |
Simple test to avoid much costs. Passing it does not mean that the word can be hyphenated.
void dw::Hyphenator::saveTrie |
( |
FILE * |
fp | ) |
|
|
inline |
HashTable< String, Hyphenator > * dw::Hyphenator::hyphenators |
|
staticprivate |
Initial value:=
new HashTable <String, Hyphenator> (true, true)
Trie* dw::Hyphenator::trie |
|
private |
The documentation for this class was generated from the following files: