1 #ifndef __SYLLABLE_H__ // -*- tab-width: 2 mode: c++ -*-
4 #ifndef __DICTIONARY_H__
5 #include "dictionary.h"
31 std::string scomponents
[5];
32 // int first_consonant;
35 // int last_consonant;
36 // diacritics diacritic;
38 Syllable(const char* _first_consonant
= NULL
,
39 const char* _padding_vowel
= NULL
,
40 const char* _vowel
= NULL
,
41 const char* _last_consonant
= NULL
,
43 Syllable(const Syllable
&sy
);
45 std::string
get_component(int i
);
46 bool set_component(int i
,const char *s
);
49 bool match(const Syllable
&sample
);
50 void apply(const Syllable
&sample
,std::vector
<Syllable
> &output
);
51 bool parse(const char *str
);
52 void standardize(std::string str
);
54 strid
to_std_id() const;
55 std::string
to_str() const;
56 std::string
to_std_str() const;
57 friend std::ostream
& operator << (std::ostream
&os
,const Syllable
&sy
);
58 friend bool operator < (const Syllable
&s1
,const Syllable
&s2
);
59 friend bool operator == (const Syllable
&s1
,const Syllable
&s2
);
62 //extern char *vowels[];
63 //extern char *first_consonants[];
64 //extern char *last_consonants[];
65 //extern char *padding_vowels[];
66 std::string
get_std_syllable(const std::string
&str
);
67 std::string
get_unstd_syllable(const std::string
&str
);
68 std::string
get_lowercased_syllable(const std::string
&str
);
69 typedef std::vector
<Syllable
> confusion_set
;
70 std::vector
<confusion_set
>& get_confusion_sets();