Skip to content

Commit

Permalink
Merge pull request #333 from google/staging_cl87592180_cl91370456
Browse files Browse the repository at this point in the history
Publish CLs from internal repository (CL 87592180 - CL 91370456)
  • Loading branch information
yukawa committed Nov 15, 2015
2 parents 2379560 + 766685b commit 95de40f
Show file tree
Hide file tree
Showing 36 changed files with 12,066 additions and 337 deletions.
6 changes: 0 additions & 6 deletions src/base/base.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
'toolsets': ['host', 'target'],
'sources': [
'cpu_stats.cc',
'encoding_util.cc',
'process.cc',
'process_mutex.cc',
'run_level.cc',
Expand All @@ -58,11 +57,6 @@
'mac_process.mm',
'mac_util.mm',
],
'link_settings': {
'libraries': [
'/usr/lib/libiconv.dylib', # used in iconv.cc
],
},
}],
['OS=="win"', {
'sources': [
Expand Down
15 changes: 0 additions & 15 deletions src/base/base_test.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -252,20 +252,6 @@
'test_size': 'small',
},
},
{
'target_name': 'encoding_util_test',
'type': 'executable',
'sources': [
'encoding_util_test.cc',
],
'dependencies': [
'../testing/testing.gyp:gtest_main',
'base.gyp:base',
],
'variables': {
'test_size': 'small',
},
},
{
'target_name': 'number_util_test',
'type': 'executable',
Expand Down Expand Up @@ -416,7 +402,6 @@
'clock_mock_test',
'clock_test',
'config_file_stream_test',
'encoding_util_test',
'encryptor_test',
'file_util_test',
'hash_test',
Expand Down
173 changes: 0 additions & 173 deletions src/base/encoding_util.cc

This file was deleted.

51 changes: 0 additions & 51 deletions src/base/encoding_util_test.cc

This file was deleted.

16 changes: 14 additions & 2 deletions src/converter/candidate_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,14 @@ const int32 kStopEnmerationCacheSize = 15;
CandidateFilter::CandidateFilter(
const SuppressionDictionary *suppression_dictionary,
const POSMatcher *pos_matcher,
const SuggestionFilter *suggestion_filter)
const SuggestionFilter *suggestion_filter,
bool apply_suggestion_filter_for_exact_match)
: suppression_dictionary_(suppression_dictionary),
pos_matcher_(pos_matcher),
suggestion_filter_(suggestion_filter),
top_candidate_(NULL) {
top_candidate_(NULL),
apply_suggestion_filter_for_exact_match_(
apply_suggestion_filter_for_exact_match) {
CHECK(suppression_dictionary_);
CHECK(pos_matcher_);
CHECK(suggestion_filter_);
Expand Down Expand Up @@ -126,6 +129,15 @@ CandidateFilter::ResultType CandidateFilter::FilterCandidateInternal(
}
FALLTHROUGH_INTENDED;
case Segments::SUGGESTION:
// For mobile, most users will use suggestion/prediction only and do not
// trigger conversion explicitly.
// So we don't apply the suggestion filter if the user input key
// is exactly the same as candidate's.
if (!apply_suggestion_filter_for_exact_match_ &&
original_key == candidate->key) {
break;
}

// In contrast to the PREDICTION mode, the SUGGESTION is triggered without
// any user actions, i.e., suggestion candidates are automatically
// displayed to users. Therefore, it's better to filter unfavorable words
Expand Down
4 changes: 3 additions & 1 deletion src/converter/candidate_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ class CandidateFilter {
CandidateFilter(
const dictionary::SuppressionDictionary *suppression_dictionary,
const dictionary::POSMatcher *pos_matcher,
const SuggestionFilter *suggestion_filter);
const SuggestionFilter *suggestion_filter,
bool apply_suggestion_filter_for_exact_match);
~CandidateFilter();

enum ResultType {
Expand Down Expand Up @@ -81,6 +82,7 @@ class CandidateFilter {

set<string> seen_;
const Segment::Candidate *top_candidate_;
bool apply_suggestion_filter_for_exact_match_;

DISALLOW_COPY_AND_ASSIGN(CandidateFilter);
};
Expand Down
Loading

0 comments on commit 95de40f

Please sign in to comment.