blob: 5473622bad0276c60a5fdfdf359a5e3ae07d5ecd (
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
44
45
46
47
48
49
50
51
52
53
54
55
56
|
/*
* libpinyin
* Library to deal with pinyin.
*
* Copyright (C) 2006-2007 Peng Wu
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef PHRASE_LOOKUP_H
#define PHRASE_LOOKUP_H
#include "novel_types.h"
#include "lookup.h"
/** @file phrase_lookup.h
* @brief the definitions of phrase lookup related classes and structs.
*/
class PhraseLookup{
private:
protected:
//saved varibles
novel::PhraseLargeTable * m_phrase_table;
novel::FacadePhraseIndex * m_phrase_index;
novel::Bigram * m_bigram;
//internal step data structure
GPtrArray * m_steps_index;
/* Array of LookupStepIndex */
GPtrArray * m_steps_content;
/* Array of LookupStepContent */
GArray * m_table_cache;
/* Array of phrase_token_t, for phrase lookup. */
public:
bool get_best_match(int sentence_length, utf16_t sentence[], MatchResults & results);
bool convert_to_utf8(MatchResults results, /* out */ char * & result_string);
};
#endif
|