Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into uim
Browse files Browse the repository at this point in the history
  • Loading branch information
shitamo committed Oct 25, 2024
2 parents b81a098 + 052219a commit 68fb395
Show file tree
Hide file tree
Showing 61 changed files with 815 additions and 811 deletions.
2 changes: 1 addition & 1 deletion src/client/client_scenario_test_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ int Loop(std::istream *input) {

if (renderer_client != nullptr) {
renderer_command.set_type(commands::RendererCommand::UPDATE);
renderer_command.set_visible(output.has_candidates());
renderer_command.set_visible(output.has_candidate_window());
*renderer_command.mutable_output() = output;
MOZC_VLOG(2) << "Sending to Renderer: " << renderer_command;
renderer_client->ExecCommand(renderer_command);
Expand Down
4 changes: 2 additions & 2 deletions src/client/client_stress_test_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

// TODO(taku)
// 1. multi-thread testing
// 2. change/config the senario
// 2. change/config the scenario

ABSL_FLAG(int32_t, max_keyevents, 100000,
"test at most |max_keyevents| key sequences");
Expand Down Expand Up @@ -137,7 +137,7 @@ int main(int argc, char **argv) {

if (renderer_client != nullptr) {
renderer_command.set_type(mozc::commands::RendererCommand::UPDATE);
renderer_command.set_visible(output.has_candidates());
renderer_command.set_visible(output.has_candidate_window());
*renderer_command.mutable_output() = output;
MOZC_VLOG(2) << "Sending to Renderer: " << renderer_command;
renderer_client->ExecCommand(renderer_command);
Expand Down
5 changes: 5 additions & 0 deletions src/data/keymap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ Shortcut keys are configurable from the preferences dialog GUI.
* overlay_kenkan_muhenkan_to_ime_on_off.tsv
+ Subset of keymap for special purpose.

## Commands

Commands are defined in
[session/internal/keymap.cc](../../session/internal/keymap.cc)

## Input modes

* Direct
Expand Down
2 changes: 1 addition & 1 deletion src/ios/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ mozc_cc_binary(
":ios_engine",
"//base:init_mozc_buildtool",
"//base/strings:unicode",
"//protocol:candidates_cc_proto",
"//protocol:candidate_window_cc_proto",
"//protocol:commands_cc_proto",
"//protocol:config_cc_proto",
"@com_google_absl//absl/flags:flag",
Expand Down
4 changes: 2 additions & 2 deletions src/ios/ios_engine_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include "base/init_mozc.h"
#include "base/strings/unicode.h"
#include "ios/ios_engine.h"
#include "protocol/candidates.pb.h"
#include "protocol/candidate_window.pb.h"
#include "protocol/commands.pb.h"
#include "protocol/config.pb.h"

Expand Down Expand Up @@ -108,7 +108,7 @@ int main(int argc, char **argv) {
} else {
std::cout << "----- preedit -----\n"
<< absl::StrCat(command.output().preedit()) << std::endl;
const auto &cands = command.output().candidates();
const auto &cands = command.output().candidate_window();
const int size =
std::min(absl::GetFlag(FLAGS_candsize), cands.candidate_size());
for (int i = 0; i < size; ++i) {
Expand Down
2 changes: 1 addition & 1 deletion src/mac/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ mozc_objc_test(
":mozc_imk_input_controller",
"//base/mac:mac_util",
"//client:client_mock",
"//protocol:candidates_cc_proto",
"//protocol:candidate_window_cc_proto",
"//renderer:renderer_interface",
"//testing:gunit_main_objc",
"@com_google_absl//absl/container:flat_hash_map",
Expand Down
4 changes: 2 additions & 2 deletions src/mac/mozc_imk_input_controller.mm
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ - (void)delayedUpdateCandidates {
}

// If there is no candidate, the candidate window is closed.
if (rendererCommand_.output().candidates().candidate_size() == 0) {
if (rendererCommand_.output().candidate_window().candidate_size() == 0) {
rendererCommand_.set_visible(false);
mozcRenderer_->ExecCommand(rendererCommand_);
return;
Expand All @@ -736,7 +736,7 @@ - (void)delayedUpdateCandidates {
rendererCommand_.set_visible(true);

NSRect preeditRect = NSZeroRect;
const int32_t position = rendererCommand_.output().candidates().position();
const int32_t position = rendererCommand_.output().candidate_window().position();
// Some applications throws error when we call attributesForCharacterIndex.
DLOG(INFO) << "attributesForCharacterIndex: " << position;
@try {
Expand Down
4 changes: 2 additions & 2 deletions src/mac/mozc_imk_input_controller_test.mm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#include "absl/time/time.h"
#include "base/mac/mac_util.h"
#include "client/client_mock.h"
#include "protocol/candidates.pb.h"
#include "protocol/candidate_window.pb.h"
#include "renderer/renderer_interface.h"
#include "testing/gmock.h"
#include "testing/googletest.h"
Expand Down Expand Up @@ -442,7 +442,7 @@ BOOL SendKeyEvent(unsigned short keyCode, MozcImkInputController *controller,
// create an output
commands::Output output;
// a candidate has to have at least a candidate
commands::CandidateWindow *candidate_window = output.mutable_candidates();
commands::CandidateWindow *candidate_window = output.mutable_candidate_window();
candidate_window->set_focused_index(0);
candidate_window->set_size(1);
commands::CandidateWindow::Candidate *candidate = candidate_window->add_candidate();
Expand Down
4 changes: 1 addition & 3 deletions src/prediction/dictionary_prediction_aggregator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1711,9 +1711,7 @@ void DictionaryPredictionAggregator::AggregateTypingCorrectedPrediction(
// insensitive dictionary lookup is also disabled as composition
// spellchecker has already fixed them.
ConversionRequest corrected_request = request;
// TODO(b/365909808): corrected_request.composer() returns nullptr. We should
// add an empty composer instead.
corrected_request.set_composer(nullptr);
corrected_request.reset_composer();
corrected_request.set_kana_modifier_insensitive_conversion(false);

// Populates number when number candidate is not added.
Expand Down
2 changes: 2 additions & 0 deletions src/prediction/dictionary_predictor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,8 @@ DictionaryPredictor::GetTypingCorrectionMixingParams(
request, segments, literal_results, typing_corrected_results);
}

typing_correction_mixing_params.literal_at_least_second = true;

return typing_correction_mixing_params;
}

Expand Down
Loading

0 comments on commit 68fb395

Please sign in to comment.