* @brief the definitions of common lookup related classes and structs.
*/
+namespace pinyin{
+
typedef phrase_token_t lookup_key_t;
struct lookup_value_t{
}
};
-namespace pinyin{
- class PinyinLargeTable;
- class PhraseLargeTable;
- class FacadePhraseIndex;
- class Bigram;
-};
-using namespace pinyin;
+class PinyinLargeTable;
+class PhraseLargeTable;
+class FacadePhraseIndex;
+class Bigram;
+
/* Note:
* LookupStepIndex:
/* Key: lookup_key_t, Value: int m, index to m_steps_content[i][m] */
typedef GArray * LookupStepContent; /* array of lookup_value_t */
+};
#endif
#include "ngram.h"
#include "phrase_lookup.h"
+using namespace pinyin;
+
const gfloat PhraseLookup::bigram_lambda;
const gfloat PhraseLookup::unigram_lambda;
* @brief the definitions of phrase lookup related classes and structs.
*/
+namespace pinyin{
+
class PhraseLookup{
private:
static const gfloat bigram_lambda = LAMBDA_PARAMETER;
bool convert_to_utf8(MatchResults results, /* in */ const char * delimiter, /* out */ char * & result_string);
};
+};
+
#endif
#include "pinyin_lookup.h"
#include "winner_tree.h"
+using namespace pinyin;
+
const gfloat PinyinLookup::bigram_lambda;
const gfloat PinyinLookup::unigram_lambda;
#include "pinyin_base.h"
#include "lookup.h"
+namespace pinyin{
+
class WinnerTree;
/** @file pinyin_lookup.h
bool destroy_pinyin_lookup(PhraseIndexRanges ranges);
};
+};
#endif
#include "pinyin_lookup.h"
#include "winner_tree.h"
+using namespace pinyin;
+
WinnerTreeBranchIterator::WinnerTreeBranchIterator(WinnerTree & tree)
:m_tree(tree), m_counter(0){
m_max_value = m_tree.m_items[m_tree.get_winner()];
#include <assert.h>
+namespace pinyin{
+
const int nbranch = 32;
class DirectBranchIterator: public IBranchIterator{//for nitem <= nbranch
void replay(int i);
};
+};
#endif
/* training module */
#include "flexible_ngram.h"
+using namespace pinyin;
+
typedef struct _pinyin_context_t pinyin_context_t;
#include "novel_types.h"
#include "ngram.h"
+using namespace pinyin;
+
struct SingleGramItem{
phrase_token_t m_token;
guint32 m_freq;
};
-using namespace pinyin;
-
-
#endif
#include "phrase_index.h"
+using namespace pinyin;
+
bool PhraseItem::set_n_pronunciation(guint8 n_prouns){
m_chunk.set_content(sizeof(guint8), &n_prouns, sizeof(guint8));
return true;
* ++++++++++++++++++++++++++++++++++++++++++
*/
-class PinyinLookup;
-
namespace pinyin{
+class PinyinLookup;
+
/* Because this is not large,
* Store this in user home directory.
*/
};
class FacadePhraseIndex{
- friend class ::PinyinLookup;
+ friend class PinyinLookup;
private:
guint32 m_total_freq;
SubPhraseIndex * m_sub_phrase_indices[PHRASE_INDEX_LIBRARY_COUNT];
};
-using namespace pinyin;
-
-
-
-
-
#endif
};
-using namespace pinyin;
-
#endif
#include "pinyin_phrase.h"
#include "pinyin_large_table.h"
+using namespace pinyin;
+
// Internal data definition
/**
PinyinTone rhs);
};
-using namespace pinyin;
-
#endif
};
-using namespace pinyin;
#endif
};
-using namespace pinyin;
-
#endif
#include "phrase_large_table.h"
#include "tag_utility.h"
+using namespace pinyin;
+
/* internal taglib structure */
struct tag_entry{
int m_line_type;
bool taglib_fini();
namespace pinyin{
- class PhraseLargeTable;
+class PhraseLargeTable;
+class FacadePhraseIndex;
};
using namespace pinyin;