summaryrefslogtreecommitdiffstats
path: root/src/lookup
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2017-01-11 15:47:21 +0800
committerPeng Wu <alexepico@gmail.com>2017-01-11 15:47:21 +0800
commit3d694bdadbfeef1c2c182c96643c3ee6ba0e5dc7 (patch)
treeb348ef3c8b2a7fa8d0cedcea32cfc81049f3b80b /src/lookup
parentafedc8c1cb28505609f7f48fd82f0684f29c207a (diff)
downloadlibpinyin-3d694bdadbfeef1c2c182c96643c3ee6ba0e5dc7.tar.gz
libpinyin-3d694bdadbfeef1c2c182c96643c3ee6ba0e5dc7.tar.xz
libpinyin-3d694bdadbfeef1c2c182c96643c3ee6ba0e5dc7.zip
update phonetic_lookup.h
Diffstat (limited to 'src/lookup')
-rw-r--r--src/lookup/phonetic_lookup.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lookup/phonetic_lookup.h b/src/lookup/phonetic_lookup.h
index f571fa5..0ea9b68 100644
--- a/src/lookup/phonetic_lookup.h
+++ b/src/lookup/phonetic_lookup.h
@@ -68,8 +68,13 @@ struct matrix_value_t {
}
};
+#if 1
/* for debug purpose */
#include "phonetic_lookup_linear.h"
+#else
+/* for optimization */
+#include "phonetic_lookup_heap.h"
+#endif
struct trellis_constraint_t {
/* the constraint type */
@@ -158,6 +163,11 @@ public:
bool validate_constraint(PhoneticKeyMatrix * matrix);
};
+/* use maximum heap to get the topest results. */
+static bool get_top_results(/* out */ GPtrArray * topresults,
+ /* in */ GPtrArray * candidates);
+
+
/* Array of MatchResults */
typedef GPtrArray * NBestMatchResults;