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"
25 Trie (
TrieNode *array = NULL,
int size = 0,
bool freeArray =
false,
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);
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);
104 Hyphenator (
const char *patFile,
const char *excFile,
int pack = 256);
115 #endif // __DW_HYPHENATOR_HH__
const char * value
Definition: hyphenator.hh:62
TrieNode * array
Definition: hyphenator.hh:19
Typed version of container::untyped::Vector.
Definition: container.hh:425
void save(FILE *file)
Definition: hyphenator.cc:544
static Hyphenator * getHyphenator(const char *language)
Definition: hyphenator.cc:115
Definition: hyphenator.hh:12
void insertPattern(TrieBuilder *trieBuilder, char *s)
Definition: hyphenator.cc:148
An object::Object wrapper for strings (char*).
Definition: object.hh:185
void insertException(char *s)
Definition: hyphenator.cc:183
Typed version of container::untyped::HashTable.
Definition: container.hh:514
const char * data1
Definition: hyphenator.hh:57
Trie * trie
Definition: hyphenator.hh:90
This is the base class for many other classes, which defines very common virtual methods.
Definition: object.hh:24
lout::misc::SimpleVector< Trie::TrieNode > * tree
Definition: hyphenator.hh:67
bool validState(int state)
Definition: hyphenator.hh:30
A simple allocator optimized to handle many small chunks of memory. The chunks can not be free'd indi...
Definition: misc.hh:626
int size
Definition: hyphenator.hh:20
uint16_t next
Definition: hyphenator.hh:14
void hyphenateSingleWord(core::Platform *platform, char *wordLc, int offset, lout::misc::SimpleVector< int > *breakPos)
Definition: hyphenator.cc:292
~TrieBuilder()
Definition: hyphenator.cc:387
lout::misc::SimpleVector< StackEntry > * stateStack
Definition: hyphenator.hh:69
~Trie()
Definition: hyphenator.cc:537
Trie(TrieNode *array=NULL, int size=0, bool freeArray=false, lout::misc::ZoneAllocator *dataZone=NULL)
Definition: hyphenator.cc:529
static Trie::TrieNode trieNodeNull
Definition: hyphenator.hh:66
Definition: hyphenator.hh:10
unsigned char c
Definition: hyphenator.hh:13
Definition: hyphenator.hh:52
bool isCharPartOfActualWord(char *s)
Definition: hyphenator.cc:225
void insert(const char *key, const char *value)
Definition: hyphenator.cc:395
TrieBuilder(int pack)
Definition: hyphenator.cc:377
const char * getData(unsigned char c, int *state)
Definition: hyphenator.hh:31
lout::misc::SimpleVector< DataEntry > * dataList
Definition: hyphenator.hh:68
int * hyphenateWord(core::Platform *platform, const char *word, int *numBreaks)
Definition: hyphenator.cc:233
~Hyphenator()
Definition: hyphenator.cc:109
int insertState(StackEntry *state, bool root)
Definition: hyphenator.cc:410
static bool isHyphenationCandidate(const char *word)
Definition: hyphenator.cc:211
Simple (simpler than container::untyped::Vector and container::typed::Vector) template based vector...
Definition: misc.hh:93
bool freeArray
Definition: hyphenator.hh:21
Trie * createTrie()
Definition: hyphenator.cc:487
const char * data[256]
Definition: hyphenator.hh:56
unsigned char c
Definition: hyphenator.hh:53
unsigned char * key
Definition: hyphenator.hh:61
int pack
Definition: hyphenator.hh:65
lout::container::typed::HashTable< lout::object::ConstString, lout::container::typed::Vector< lout::object::Integer > > * exceptions
Definition: hyphenator.hh:94
lout::misc::ZoneAllocator * dataZone
Definition: hyphenator.hh:70
Definition: hyphenator.hh:60
An object::Object wrapper for constant strings (char*).
Definition: object.hh:162
void stateStackPush(unsigned char c)
Definition: hyphenator.cc:460
Dw is in this namespace, or sub namespaces of this one.
Definition: alignedtablecell.cc:28
An object::Object wrapper for int's.
Definition: object.hh:126
Definition: hyphenator.hh:50
static lout::container::typed::HashTable< lout::object::String, Hyphenator > * hyphenators
Definition: hyphenator.hh:89
void insertSorted(unsigned char *key, const char *value)
Definition: hyphenator.cc:507
int load(FILE *file)
Definition: hyphenator.cc:556
void saveTrie(FILE *fp)
Definition: hyphenator.hh:110
int next[256]
Definition: hyphenator.hh:55
lout::misc::ZoneAllocator * dataZone
Definition: hyphenator.hh:22
Hyphenator(const char *patFile, const char *excFile, int pack=256)
Definition: hyphenator.cc:48
static FltkPlatform * platform
Definition: dw_anchors_test.cc:37
const char * data
Definition: hyphenator.hh:15
static int keyCompare(const void *p1, const void *p2)
Definition: hyphenator.cc:402
int count
Definition: hyphenator.hh:54
int stateStackPop()
Definition: hyphenator.cc:468
Definition: hyphenator.hh:86
static const int root
Definition: hyphenator.hh:29