File: scim_pinyin_smart_match.h

package info (click to toggle)
scim-chinese 0.4.2-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 13,260 kB
  • ctags: 2,407
  • sloc: cpp: 9,772; sh: 9,305; ansic: 8,530; makefile: 602; yacc: 288; sed: 16
file content (84 lines) | stat: -rw-r--r-- 2,474 bytes parent folder | download
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/** @file scim_smart_match.h
 * Smart pinyin match functions.
 */

/* 
 * Smart Common Input Method
 * 
 * Copyright (c) 2002 James Su <suzhe@turbolinux.com.cn>
 *
 * $Id: scim_pinyin_smart_match.h,v 1.1.1.1 2004/04/29 05:12:41 suzhe Exp $
 */

#if !defined (__SCIM_PINYIN_SMART_MATCH_H)
#define __SCIM_PINYIN_SMART_MATCH_H

using namespace scim;

typedef std::vector <CharVector>   CharVectorVector;
typedef std::vector <PhraseVector> PhraseVectorVector;

/**
 * search out all matched phrases according to keys begin to end.
 */

size_t
scim_pinyin_search_matches (CharVector      & chars,
							PhraseVector    & phrases,
							PinyinParsedKeyVector::const_iterator begin,
							PinyinParsedKeyVector::const_iterator end,
							PinyinTable     * pinyin_table,
							PinyinPhraseLib * usr_lib,
							PinyinPhraseLib * sys_lib,
							const IConvert  * validator_one = 0,
							const IConvert  * validator_two = 0,
							bool              new_search    = false,
							bool              match_longer  = false);

void
scim_pinyin_update_matches_cache (CharVectorVector   & chars_cache,
								  PhraseVectorVector & phrases_cache,
								  PinyinParsedKeyVector::const_iterator begin,
								  PinyinParsedKeyVector::const_iterator end,
								  PinyinParsedKeyVector::const_iterator invalid,
								  PinyinTable     * pinyin_table,
								  PinyinPhraseLib * usr_lib,
								  PinyinPhraseLib * sys_lib,
								  const IConvert  * validator_one = 0,
								  const IConvert  * validator_two = 0,
								  bool              full_search   = false,
								  bool              match_longer  = false);

/**
 * 
 * @param matched_phrases the phrases which is matched with the keys,
 *                        a zero length phrase indicates a char.
 *
 * @param phrases_cache   the cache to store all searched phrases for each key.
 *
 */

WideString
scim_pinyin_smart_match (PhraseVector       & matched_phrases,

						 CharVectorVector::iterator    chars_cache,

						 PhraseVectorVector::iterator  phrases_cache,

						 PinyinParsedKeyVector::const_iterator begin,
						 PinyinParsedKeyVector::const_iterator end,

						 PinyinTable        * pinyin_table,

						 PinyinPhraseLib    * usr_lib,
						 PinyinPhraseLib    * sys_lib,

						 uint32               recursive_max = 100,

						 const IConvert     * validator_one = NULL,
						 const IConvert     * validator_two = NULL);

#endif // End of __SCIM_PINYIN_SMART_MATCH_H
/*
vi:ts=4:nowrap:ai
*/