aboutsummaryrefslogtreecommitdiff
path: root/dw/hyphenator.hh
blob: 839f6cc91d2127fbf0a93ace3728ac7de6ae0fa4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef __DW_HYPHENATOR_HH__
#define __DW_HYPHENATOR_HH__

#include "../lout/object.hh"
#include "../lout/container.hh"
#include "../dw/core.hh"

namespace dw {

class Hyphenator: public lout::object::Object
{
private:
   static lout::container::typed::HashTable
   <lout::object::TypedPair <lout::object::TypedPointer <core::Platform>,
                             lout::object::ConstString>,
    Hyphenator> *hyphenators;

   /*
    * Actually, only one method in Platform is needed:
    * textToLower(). And, IMO, this method is actually not platform
    * independant, but based on UTF-8. Clarify? Change?
    */
   core::Platform *platform;
   lout::container::typed::HashTable <lout::object::Integer,
                                      lout::container::typed::Collection
                                      <lout::object::Integer> > *tree;
   void insertPattern (char *s);

public:
   Hyphenator (core::Platform *platform, const char *filename);
   ~Hyphenator();

   static Hyphenator *getHyphenator (core::Platform *platform,
                                     const char *language);
   static bool isHyphenationCandidate (const char *word);
   
   lout::container::typed::Vector <lout::object::String>
   *hyphenateWord(const char *word);
};

} // namespace dw

#endif // __DW_HYPHENATOR_HH__