summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2016-03-30 15:25:05 +0800
committerPeng Wu <alexepico@gmail.com>2016-03-30 15:25:05 +0800
commit836ea17130bd54b60c0d51ffc656b28106e73d1a (patch)
tree51a47dbc31fbb18b608ec49f06bb3625927483cc
parent71bfcb74f432e0d2ea067da53cdc765f54c2e36c (diff)
downloadlibpinyin-836ea17130bd54b60c0d51ffc656b28106e73d1a.tar.gz
libpinyin-836ea17130bd54b60c0d51ffc656b28106e73d1a.tar.xz
libpinyin-836ea17130bd54b60c0d51ffc656b28106e73d1a.zip
fixes warnings
-rw-r--r--utils/storage/gen_binary_files.cpp1
-rw-r--r--utils/storage/gen_pinyin_table.cpp3
-rw-r--r--utils/training/estimate_interpolation.cpp4
-rw-r--r--utils/training/eval_correction_rate.cpp1
-rw-r--r--utils/training/prune_k_mixture_model.cpp2
5 files changed, 3 insertions, 8 deletions
diff --git a/utils/storage/gen_binary_files.cpp b/utils/storage/gen_binary_files.cpp
index 8ffb5fc..932c1cd 100644
--- a/utils/storage/gen_binary_files.cpp
+++ b/utils/storage/gen_binary_files.cpp
@@ -36,7 +36,6 @@ bool generate_binary_files(const char * pinyin_table_filename,
const char * phrase_table_filename,
const pinyin_table_info_t * phrase_files) {
/* generate pinyin index*/
- pinyin_option_t options = USE_TONE;
ChewingLargeTable2 pinyin_table;
pinyin_table.attach(pinyin_table_filename, ATTACH_READWRITE|ATTACH_CREATE);
diff --git a/utils/storage/gen_pinyin_table.cpp b/utils/storage/gen_pinyin_table.cpp
index 4b7073e..36ce0aa 100644
--- a/utils/storage/gen_pinyin_table.cpp
+++ b/utils/storage/gen_pinyin_table.cpp
@@ -288,7 +288,6 @@ void gen_phrase_file(const char * outputfile, int phrase_index){
(chewing_and_freqs, chewing_and_freq_item, n);
ChewingKeyVector keys = chewing_and_freq->keys;
- ChewingKeyRestVector key_rests = chewing_and_freq->key_rests;
GArray * pinyins = g_array_new(TRUE, FALSE, sizeof(gchar *));
gchar * pinyin = NULL;
@@ -296,8 +295,6 @@ void gen_phrase_file(const char * outputfile, int phrase_index){
size_t k;
for (k = 0; k < keys->len; ++k) {
ChewingKey key = g_array_index(keys, ChewingKey, k);
- ChewingKeyRest key_rest = g_array_index
- (key_rests, ChewingKeyRest, k);
//assert (CHEWING_ZERO_TONE != key.m_tone);
pinyin = key.get_pinyin_string();
diff --git a/utils/training/estimate_interpolation.cpp b/utils/training/estimate_interpolation.cpp
index b8687ee..a966720 100644
--- a/utils/training/estimate_interpolation.cpp
+++ b/utils/training/estimate_interpolation.cpp
@@ -45,7 +45,7 @@ parameter_t compute_interpolation(SingleGram * deleted_bigram,
BigramPhraseWithCountArray array = g_array_new(FALSE, FALSE, sizeof(BigramPhraseItemWithCount));
deleted_bigram->retrieve_all(array);
- for ( int i = 0; i < array->len; ++i){
+ for (size_t i = 0; i < array->len; ++i){
BigramPhraseItemWithCount * item = &g_array_index(array, BigramPhraseItemWithCount, i);
//get the phrase token
phrase_token_t token = item->m_token;
@@ -117,7 +117,7 @@ int main(int argc, char * argv[]){
parameter_t lambda_sum = 0;
int lambda_count = 0;
- for ( int i = 0; i < deleted_items->len; ++i ){
+ for (size_t i = 0; i < deleted_items->len; ++i ){
phrase_token_t * token = &g_array_index(deleted_items, phrase_token_t, i);
SingleGram * single_gram = NULL;
bigram.load(*token, single_gram);
diff --git a/utils/training/eval_correction_rate.cpp b/utils/training/eval_correction_rate.cpp
index f2bfadf..a8338df 100644
--- a/utils/training/eval_correction_rate.cpp
+++ b/utils/training/eval_correction_rate.cpp
@@ -160,7 +160,6 @@ int main(int argc, char * argv[]){
char* linebuf = NULL; size_t size = 0;
TokenVector tokens = g_array_new(FALSE, TRUE, sizeof(phrase_token_t));
- phrase_token_t token = null_token;
while( getline(&linebuf, &size, evals_file) ) {
if ( feof(evals_file) )
break;
diff --git a/utils/training/prune_k_mixture_model.cpp b/utils/training/prune_k_mixture_model.cpp
index 40dfb87..28fb4ca 100644
--- a/utils/training/prune_k_mixture_model.cpp
+++ b/utils/training/prune_k_mixture_model.cpp
@@ -56,7 +56,7 @@ bool prune_k_mixture_model(KMixtureModelMagicHeader * magic_header,
phrase_token_t token = item->m_token;
parameter_t remained_poss = 1; parameter_t one_poss = 0;
bool errors = false;
- for ( size_t k = 0; k < g_prune_k; ++k){
+ for (ssize_t k = 0; k < g_prune_k; ++k){
one_poss = compute_Pr_G_3_with_count
(k, magic_header->m_N, item->m_item.m_WC,
magic_header->m_N - item->m_item.m_N_n_0,