diff options
author | Peng Wu <alexepico@gmail.com> | 2011-11-14 10:39:16 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2011-11-14 10:41:08 +0800 |
commit | 33d64f5e310e9a61a2031d1988251fe351540255 (patch) | |
tree | 40446b4db3c9ae20400331cb675c56e4870aa8e2 | |
parent | e1680b821e3d59010c664a3d6046179bb8281430 (diff) | |
download | libpinyin-33d64f5e310e9a61a2031d1988251fe351540255.tar.gz libpinyin-33d64f5e310e9a61a2031d1988251fe351540255.tar.xz libpinyin-33d64f5e310e9a61a2031d1988251fe351540255.zip |
clean up code
-rw-r--r-- | src/include/stl_lite.h | 6 | ||||
-rw-r--r-- | src/lookup/pinyin_lookup.cpp | 9 |
2 files changed, 6 insertions, 9 deletions
diff --git a/src/include/stl_lite.h b/src/include/stl_lite.h index e92b656..c9f7c88 100644 --- a/src/include/stl_lite.h +++ b/src/include/stl_lite.h @@ -91,8 +91,6 @@ namespace std_lite{ _T1 first; ///< @c first is a copy of the first object _T2 second; ///< @c second is a copy of the second object - // _GLIBCXX_RESOLVE_LIB_DEFECTS - // 265. std::pair::pair() effects overly restrictive /** The default constructor creates @c first and @c second using their * respective default constructors. */ pair() @@ -257,8 +255,8 @@ namespace std_lite{ * * This is equivalent to * @code - * std::make_pair(lower_bound(first, last, val, comp), - * upper_bound(first, last, val, comp)) + * std_lite::make_pair(lower_bound(first, last, val, comp), + * upper_bound(first, last, val, comp)) * @endcode * but does not actually call those functions. */ diff --git a/src/lookup/pinyin_lookup.cpp b/src/lookup/pinyin_lookup.cpp index d6ba68c..99e2a20 100644 --- a/src/lookup/pinyin_lookup.cpp +++ b/src/lookup/pinyin_lookup.cpp @@ -21,7 +21,6 @@ #include <math.h> #include <assert.h> -#include <iostream> #include "stl_lite.h" #include "novel_types.h" #include "pinyin_base.h" @@ -118,7 +117,7 @@ size_t PinyinLookup::prepare_table_cache(int nstep, int total_pinyin){ pinyin_keys += nstep; g_array_set_size(m_table_cache, MAX_PHRASE_LENGTH + 1); - int len, total_len = std::min(total_pinyin, MAX_PHRASE_LENGTH); + int len, total_len = std_lite::min(total_pinyin, MAX_PHRASE_LENGTH); /* probe constraint */ for ( len = 1; len <= total_len; ++len) { @@ -126,7 +125,7 @@ size_t PinyinLookup::prepare_table_cache(int nstep, int total_pinyin){ if (constraint->m_type == CONSTRAINT_ONESTEP) break; } - total_len = std::min(len, total_len); + total_len = std_lite::min(len, total_len); for ( len = 1; len <= total_len; ++len){ PhraseIndexRanges * ranges = &g_array_index(m_table_cache, PhraseIndexRanges, len); @@ -462,8 +461,8 @@ bool PinyinLookup::train_result(PinyinKeyVector keys, CandidateConstraints const }else{ train_next = false; } - //add pi-gram frequency - //std::cout<<"i:"<<i<<"last_token:"<<last_token<<"\ttoken:"<<*token<<std::endl; + //add pi-gram frequency + //printf("i:%d\tlast_token:%d\ttoken:%d\n", i, last_token, *token); m_phrase_index->get_phrase_item(*token, m_cache_phrase_item); m_cache_phrase_item.increase_pinyin_possibility(*m_custom, pinyin_keys + i, train_factor); m_phrase_index->add_unigram_frequency(*token, train_factor); |