diff --git a/src/.bazelrc b/src/.bazelrc index 2f8a716a4..058a0c88e 100644 --- a/src/.bazelrc +++ b/src/.bazelrc @@ -65,12 +65,6 @@ test:macos_env --test_tag_filters=-nomac build:windows_env --build_tag_filters=-nowin test:windows_env --test_tag_filters=-nowin -# A temporary workaround to make "mozc_win_build_rule" work. -# Note that "incompatible_enable_cc_toolchain_resolution" is now enabled by -# default. See https://github.com/bazelbuild/bazel/issues/7260 -# TODO: Re-enable "incompatible_enable_cc_toolchain_resolution" -build:windows_env --noincompatible_enable_cc_toolchain_resolution - # Android specific options build:android_env --copt "-DOS_ANDROID" build:android_env --build_tag_filters=-noandroid diff --git a/src/base/strings/BUILD.bazel b/src/base/strings/BUILD.bazel index 9eeb704a0..458067b99 100644 --- a/src/base/strings/BUILD.bazel +++ b/src/base/strings/BUILD.bazel @@ -108,9 +108,7 @@ mozc_cc_library( "japanese.cc", ], hdrs = ["japanese.h"], - visibility = [ - "//:__subpackages__", - ], + visibility = ["//:__subpackages__"], deps = [ "//base/strings/internal:double_array", "//base/strings/internal:japanese_rules", diff --git a/src/prediction/dictionary_prediction_aggregator.cc b/src/prediction/dictionary_prediction_aggregator.cc index f91691044..316334f5a 100644 --- a/src/prediction/dictionary_prediction_aggregator.cc +++ b/src/prediction/dictionary_prediction_aggregator.cc @@ -1713,13 +1713,6 @@ void DictionaryPredictionAggregator::AggregateTypingCorrectedPrediction( // Populates number when number candidate is not added. bool number_added = base_selected_types & NUMBER; - if (!request.request() - .decoder_experiment_params() - .typing_correction_enable_number_decoder()) { - // disables number decoder by assuming that number candidate - // is already added. - number_added = true; - } for (const auto &query : queries) { absl::string_view key = query.correction; diff --git a/src/prediction/dictionary_prediction_aggregator_test.cc b/src/prediction/dictionary_prediction_aggregator_test.cc index ad8fa64d8..6853e1280 100644 --- a/src/prediction/dictionary_prediction_aggregator_test.cc +++ b/src/prediction/dictionary_prediction_aggregator_test.cc @@ -2200,9 +2200,6 @@ TEST_F(DictionaryPredictionAggregatorTest, config_->set_use_typing_correction(true); - request_->mutable_decoder_experiment_params() - ->set_typing_correction_enable_number_decoder(true); - Segments segments; SetUpInputForSuggestionWithHistory("にしゆうこ", "", "", composer_.get(), &segments); @@ -2216,23 +2213,12 @@ TEST_F(DictionaryPredictionAggregatorTest, data_and_aggregator->set_supplemental_model(mock.get()); - request_->mutable_decoder_experiment_params() - ->set_typing_correction_enable_number_decoder(false); std::vector results; - aggregator.AggregateTypingCorrectedPrediction(*prediction_convreq_, segments, - &results); - EXPECT_EQ(results.size(), 1); - - request_->mutable_decoder_experiment_params() - ->set_typing_correction_enable_number_decoder(true); - results.clear(); aggregator.AggregateTypingCorrectedPrediction(*prediction_convreq_, segments, &results); EXPECT_EQ(results.size(), 2); EXPECT_EQ(results[1].value, "25"); // default is full width. - request_->mutable_decoder_experiment_params() - ->set_typing_correction_enable_number_decoder(false); data_and_aggregator->set_supplemental_model(nullptr); } diff --git a/src/prediction/dictionary_predictor.cc b/src/prediction/dictionary_predictor.cc index 56ef64e85..4fa34c4fd 100644 --- a/src/prediction/dictionary_predictor.cc +++ b/src/prediction/dictionary_predictor.cc @@ -510,13 +510,10 @@ void DictionaryPredictor::MaybeSuppressAggressiveTypingCorrection( // Top is already literal. const auto &top_result = results->front(); - const auto ¶ms = request.request().decoder_experiment_params(); - auto is_typing_correction = [&](const Result &result) { - return (result.types & PredictionType::TYPING_CORRECTION || - (params.fix_legacy_typing_correction_behavior() && - (result.candidate_attributes & - Segment::Candidate::TYPING_CORRECTION))); + return ( + result.types & PredictionType::TYPING_CORRECTION || + (result.candidate_attributes & Segment::Candidate::TYPING_CORRECTION)); }; if (!is_typing_correction(*top_result)) { diff --git a/src/prediction/dictionary_predictor_test.cc b/src/prediction/dictionary_predictor_test.cc index 2eebf2958..7bf7bc1b1 100644 --- a/src/prediction/dictionary_predictor_test.cc +++ b/src/prediction/dictionary_predictor_test.cc @@ -1764,14 +1764,11 @@ TEST_F(DictionaryPredictorTest, MaybeSuppressAggressiveTypingCorrectionTest) { EXPECT_EQ(get_top_value(), "value_0"); // top is typing correction. EXPECT_EQ(get_second_value(), "value_3"); // second is literal. - // Tests fix_legacy_typing_correction_behavior reset_results_ptrs(); params.literal_on_top = true; params.literal_at_least_second = false; results[3].candidate_attributes = Segment::Candidate::TYPING_CORRECTION; - request_->mutable_decoder_experiment_params() - ->set_fix_legacy_typing_correction_behavior(true); DictionaryPredictorTestPeer::MaybeSuppressAggressiveTypingCorrection( *convreq_for_suggestion_, params, &results_ptrs); EXPECT_EQ(get_top_value(), "value_4"); diff --git a/src/protocol/commands.proto b/src/protocol/commands.proto index f50cb3951..62d28e7fc 100644 --- a/src/protocol/commands.proto +++ b/src/protocol/commands.proto @@ -593,9 +593,6 @@ message DecoderExperimentParams { // Bitmap of enabled variation character types. optional uint32 variation_character_types = 8 [default = 0]; - // Applies the number decoder to the output of typing corrector - optional bool typing_correction_enable_number_decoder = 89 [default = false]; - // Enables final results reranking against literal results. // If zero, the previous implementation is used. optional int32 typing_correction_result_reranker_mode = 95 [default = 0]; @@ -662,9 +659,6 @@ message DecoderExperimentParams { // <= katakana_override_min_per_char_cost optional int32 katakana_override_min_per_char_cost = 91 [default = 0]; - // Treats the legacy typing correction candidate as - // literal-on-top or literal-at-least-second. - optional bool fix_legacy_typing_correction_behavior = 92 [default = false]; } // Clients' request to the server.