summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2017-01-16 15:48:02 +0800
committerPeng Wu <alexepico@gmail.com>2017-01-16 15:48:02 +0800
commit868a9c98d73f4969a55b2c86abf9e575a8cf166c (patch)
tree4351b61eaefea9e3a274c63492fda4b577252ba8 /src
parent425a56dc706ee75ecbe4fc538b97f24541077686 (diff)
downloadlibpinyin-868a9c98d73f4969a55b2c86abf9e575a8cf166c.tar.gz
libpinyin-868a9c98d73f4969a55b2c86abf9e575a8cf166c.tar.xz
libpinyin-868a9c98d73f4969a55b2c86abf9e575a8cf166c.zip
fixes compile
Diffstat (limited to 'src')
-rw-r--r--src/lookup/phonetic_lookup.cpp9
-rw-r--r--src/lookup/phonetic_lookup.h8
-rw-r--r--src/lookup/phonetic_lookup_heap.h2
-rw-r--r--src/lookup/phonetic_lookup_linear.h3
4 files changed, 13 insertions, 9 deletions
diff --git a/src/lookup/phonetic_lookup.cpp b/src/lookup/phonetic_lookup.cpp
index 45536b2..d343e6d 100644
--- a/src/lookup/phonetic_lookup.cpp
+++ b/src/lookup/phonetic_lookup.cpp
@@ -27,8 +27,7 @@ static bool get_top_results(/* out */ GPtrArray * topresults,
/* in */ GPtrArray * candidates);
-int ForwardPhoneticConstraints::add_constraint(CandidateConstraints constraints,
- size_t start, size_t end,
+int ForwardPhoneticConstraints::add_constraint(size_t start, size_t end,
phrase_token_t token) {
if (end > constraints->len)
@@ -55,8 +54,7 @@ int ForwardPhoneticConstraints::add_constraint(CandidateConstraints constraints,
return end - start;
}
-bool ForwardPhoneticConstraints::clear_constraint(CandidateConstraints constraints,
- size_t index) {
+bool ForwardPhoneticConstraints::clear_constraint(size_t index) {
if (index < 0 || index >= constraints->len)
return false;
@@ -88,8 +86,7 @@ bool ForwardPhoneticConstraints::clear_constraint(CandidateConstraints constrain
return true;
}
-bool ForwardPhoneticConstraints::validate_constraint(PhoneticKeyMatrix * matrix,
- CandidateConstraints constraints) {
+bool ForwardPhoneticConstraints::validate_constraint(PhoneticKeyMatrix * matrix) {
/* resize constraints array first */
const size_t oldlength = constraints->len;
const size_t newlength = matrix->size();
diff --git a/src/lookup/phonetic_lookup.h b/src/lookup/phonetic_lookup.h
index 43a2936..6ca7d4f 100644
--- a/src/lookup/phonetic_lookup.h
+++ b/src/lookup/phonetic_lookup.h
@@ -24,6 +24,8 @@
#include "novel_types.h"
#include <limits.h>
+#include "phonetic_key_matrix.h"
+#include "ngram.h"
namespace pinyin{
@@ -79,6 +81,8 @@ struct matrix_value_t {
#include "phonetic_lookup_heap.h"
#endif
+enum constraint_type{NO_CONSTRAINT, CONSTRAINT_ONESTEP, CONSTRAINT_NOSEARCH };
+
struct trellis_constraint_t {
/* the constraint type */
constraint_type m_type;
@@ -201,10 +205,10 @@ protected:
PhraseIndexRanges ranges);
bool unigram_gen_next_step(int start, int end,
- lookup_value_t * cur_step,
+ trellis_value_t * cur_step,
phrase_token_t token);
bool bigram_gen_next_step(int start, int end,
- lookup_value_t * cur_step,
+ trellis_value_t * cur_step,
phrase_token_t token,
gfloat bigram_poss);
diff --git a/src/lookup/phonetic_lookup_heap.h b/src/lookup/phonetic_lookup_heap.h
index 3a3d596..8af1767 100644
--- a/src/lookup/phonetic_lookup_heap.h
+++ b/src/lookup/phonetic_lookup_heap.h
@@ -102,6 +102,7 @@ public:
};
+#if 0
static inline bool matrix_value_more_than(const matrix_value_t &lhs,
const matrix_value_t &rhs) {
/* min heap here */
@@ -179,6 +180,7 @@ public:
return false;
}
};
+#endif
#endif
diff --git a/src/lookup/phonetic_lookup_linear.h b/src/lookup/phonetic_lookup_linear.h
index 001ef39..fadc2bc 100644
--- a/src/lookup/phonetic_lookup_linear.h
+++ b/src/lookup/phonetic_lookup_linear.h
@@ -64,6 +64,7 @@ public:
}
};
+#if 0
template <gint32 nbest>
struct matrix_step {
private:
@@ -106,6 +107,6 @@ public:
return false;
}
};
-
+#endif
#endif