1#ifndef __DW_HYPHENATOR_HH__
2#define __DW_HYPHENATOR_HH__
4#include "../lout/object.hh"
5#include "../lout/container.hh"
6#include "../dw/core.hh"
31 inline const char *
getData (
unsigned char c,
int *state)
39 *state = tn->
next > 0 ? tn->
next : -1;
46 void save (FILE *file);
47 int load (FILE *file);
67 lout::misc::SimpleVector <Trie::TrieNode> *
tree;
68 lout::misc::SimpleVector <DataEntry> *
dataList;
72 static int keyCompare (
const void *p1,
const void *p2);
76 void insertSorted (
unsigned char *key,
const char *value);
82 void insert (
const char *key,
const char *value);
100 lout::misc::SimpleVector <int> *breakPos);
104 Hyphenator (
const char *patFile,
const char *excFile,
int pack = 256);
void insertException(char *s)
bool isCharPartOfActualWord(char *s)
Test whether the character on which "s" points (UTF-8) is an actual part of the word.
void hyphenateSingleWord(core::Platform *platform, char *wordLc, int offset, lout::misc::SimpleVector< int > *breakPos)
Hyphenate a single word, which only consists of lowercase characters.
static lout::container::typed::HashTable< lout::object::String, Hyphenator > * hyphenators
static Hyphenator * getHyphenator(const char *language)
int * hyphenateWord(core::Platform *platform, const char *word, int *numBreaks)
Given a word, returns a list of the possible hyphenation points.
static bool isHyphenationCandidate(const char *word)
Simple test to avoid much costs.
lout::container::typed::HashTable< lout::object::ConstString, lout::container::typed::Vector< lout::object::Integer > > * exceptions
void insertPattern(TrieBuilder *trieBuilder, char *s)
void insertSorted(unsigned char *key, const char *value)
lout::misc::ZoneAllocator * dataZone
static int keyCompare(const void *p1, const void *p2)
int insertState(StackEntry *state, bool root)
lout::misc::SimpleVector< Trie::TrieNode > * tree
void stateStackPush(unsigned char c)
lout::misc::SimpleVector< StackEntry > * stateStack
lout::misc::SimpleVector< DataEntry > * dataList
void insert(const char *key, const char *value)
static Trie::TrieNode trieNodeNull
bool validState(int state)
lout::misc::ZoneAllocator * dataZone
const char * getData(unsigned char c, int *state)
Typed version of container::untyped::HashTable.
Typed version of container::untyped::Vector.
A simple allocator optimized to handle many small chunks of memory.
An object::Object wrapper for constant strings (char*).
An object::Object wrapper for int's.
This is the base class for many other classes, which defines very common virtual methods.
An object::Object wrapper for strings (char*).
static FltkPlatform * platform
Dw is in this namespace, or sub namespaces of this one.