4511 Commits

Author SHA1 Message Date
6b16135208 Rollback the version of protobuf from 29.3 to 29.1.
Due to the build failure on Windows.

PiperOrigin-RevId: 725882606
2025-02-12 04:37:08 +00:00
b49001915a Support realtime conversion for handwriting input
ばらが→薔薇が
きょうははれ→今日は晴れ

PiperOrigin-RevId: 725875285
2025-02-12 04:06:18 +00:00
4925e83093 Fix the build error of com_test.cc
* Add explicit virtual deconstrutors to mock classes.

#codehealth

PiperOrigin-RevId: 725856898
2025-02-12 02:51:20 +00:00
2da6c963eb Rollback the version of third_party/protobuf from v29.3 to v29.1
Due to the build error on Windows (#1179).
2025-02-11 17:10:04 +00:00
813eff7841 Update dependencies of abseil-cpp, protobuf and googletest in MODULE.bazel
* Use MODULE.bazel of Bazel instead of submodules of git.
* abseil: 2024722 → 20250127
* protobuf: 29.1 → 29.3
* googletest: 1.15.2 → 1.16.0

#codehealth

PiperOrigin-RevId: 725116251
2025-02-10 09:33:36 +00:00
7f686f1ee1 Update Android NDK in Dockerfile to r28 (#1176)
Android NDK r28 is released with 16 KiB page size compatibility option
enabled by default [1].

Let's update our Dockerfile to make it clear that libmozc.so is
compatible with 16 KiB page size.

 [1]: https://github.com/android/ndk/releases/tag/r28

PiperOrigin-RevId: 725115333
2025-02-10 20:28:08 +09:00
011f9de746 Update rules_android_ndk to 0.1.13 (#1175)
This follows up to my previous commit [1], which aimed to make
'rules_android_ndk' compatible with 'allow_empty_glob' (#1150) with our own
local patch.

As rules_android_ndk 0.1.13 does include the fix [2], we no longer need to
keep maintaining our local patch.

 [1]: 990c417cd4
 [2]: https://github.com/bazelbuild/rules_android_ndk/pull/98

PiperOrigin-RevId: 725114927
2025-02-10 20:27:17 +09:00
0252291bb9 Remove tiny_storage and registory. They were mainly used in usage_stats.
PiperOrigin-RevId: 725108576
2025-02-10 09:04:59 +00:00
0a143847a6 Fix build failures for Windows.
* Fixed the unused error in process_watch_dog_test.cc
* Fixed the non-virtual destructor error in com_inplements_test.cc

#codehealth

PiperOrigin-RevId: 725105920
2025-02-10 08:54:41 +00:00
9979b6309f Set mobile request based on the engine type
PiperOrigin-RevId: 725105687
2025-02-10 08:53:55 +00:00
b733eab221 Initializes incoginito_config laizily to avoid a deep copy of config on
each key event.

PiperOrigin-RevId: 725100285
2025-02-10 08:33:08 +00:00
501f97cac0 Stop "混ぜ書き" handwriting looking up when the composition does not contain Hiragana.
PiperOrigin-RevId: 725085876
2025-02-10 07:33:49 +00:00
057830511e Removed typing_correction_legacy_expansion_mode.
Always populates new typing scores to all typing corrections generated by the legacy components.

PiperOrigin-RevId: 724633620
2025-02-08 10:34:44 +00:00
289147804b Removed usage_stats feature. UsageStats is no longer used.
PiperOrigin-RevId: 723855520
2025-02-06 10:39:15 +00:00
bb327ff393 Add variants::GetDescription() and variants::GetPrefix().
* This reduces the scope of SetDescription() and mutable Candidate.

#codehelath

PiperOrigin-RevId: 723805440
2025-02-06 07:37:35 +00:00
48a716dfa2 Update third_party/gtest to v1.16.0 2025-02-10 09:17:36 +00:00
ed552bae4e Update third_party/protobuf to v29.3 2025-02-10 09:16:16 +00:00
0bc6bdb016 Update third_party/abseil-cpp to 20250127.0 2025-02-10 09:15:05 +00:00
3baa8d865d Fixed problems related to date conversion function, etc. (#1173)
* Fixed problems related to date conversion function, etc.

Resolved a minor issue where a recent typographical error temporarily disabled the date conversion function and other functions.

Fix typos:
DATA => DATE
REWRITERS => REWRITER

MOZC_DATA_REWRITER => MOZC_DATE_REWRITER
MOZC_DATE_REWRITERS => MOZC_DATE_REWRITER
MOZC_FORTUNE_REWRITERS => MOZC_FORTUNE_REWRITER

* Fixed an unmodified comment when moving SessionConverter from session/ to engine/.

MOZC_SESSION_SESSION_CONVERTER_INTERFACE_H_ => MOZC_ENGINE_SESSION_CONVERTER_INTERFACE_H_

PiperOrigin-RevId: 723805096
2025-02-07 02:09:27 +09:00
4175e0dc32 PreeditHandler: update preedit string when it's empty (#1174)
See also https://bugreports.qt.io/browse/QTBUG-127995 , Deleted
character appears again when switching languages (Mozc / IBus)

PiperOrigin-RevId: 723804210
2025-02-07 02:08:46 +09:00
1fa3dd4444 Use const T& for the constructor of UserSegmentHistoryRewriter.
#codehealth

PiperOrigin-RevId: 723744533
2025-02-06 03:15:57 +00:00
380f4f3169 Use Dictionary as const& to Rewriter constructors.
#codehealth

PiperOrigin-RevId: 723744125
2025-02-06 03:14:09 +00:00
2fd4185e51 Change Candidate to class.
PiperOrigin-RevId: 723703289
2025-02-06 00:58:10 +00:00
a8b975aea4 Pass DataManager as const& to Rewriter constructors.
#codehealth

PiperOrigin-RevId: 723474493
2025-02-05 13:36:24 +00:00
fddcd2eb23 - Remove depedency from Session to EngineOutput
- stop using pure static class, EngineOutput. uses output namespace instead.
- cleanup visibility.

PiperOrigin-RevId: 723422177
2025-02-05 10:09:24 +00:00
8409b8de12 Add candidate.cc to converter_base.gyp
* Follow-up to cl/722571186
* This will fix build errors with GYP.

#codehealth

PiperOrigin-RevId: 723383845
2025-02-05 07:55:15 +00:00
f62f2e5dac Code cleanup in variants_rewriter.cc
* Use for-each loop
* Use converter::Candidate instead of Segment::Candidate
* Simplify string conversions

#codehealth

PiperOrigin-RevId: 723363281
2025-02-05 06:31:19 +00:00
775a396b09 Code update of CorrectionRewriter.
#codehealth

PiperOrigin-RevId: 723362905
2025-02-05 06:29:32 +00:00
a78066135a Stop using const pointer to set request, config, and table.
Pointers can be nullable, and introduce a level of complexity that can make code harder to read, write, and debug.

PiperOrigin-RevId: 723300545
2025-02-05 02:13:45 +00:00
306e9fae5c Remove dependency from dictionary_impl_test.cc to converter.
PiperOrigin-RevId: 722884018
2025-02-04 02:46:26 +00:00
2158213129 Move Segments::Candidate out as Candidate in candidate.h.
#codehealth

PiperOrigin-RevId: 722571186
2025-02-03 10:21:20 +00:00
879ad43ed5 Refactor the logic of inserting and deleting candidates.
#codehealth

PiperOrigin-RevId: 722526225
2025-02-03 07:31:56 +00:00
3267df5b00 Refactor to extract a logic to create an alternative candidate.
* The behavior should not be changed.
* Add CreateAlternativeCandidate to extract a logic of a new candidate creation from RewriteSegment.

#codehealth

PiperOrigin-RevId: 722525552
2025-02-03 07:28:37 +00:00
2a2f6cf3d3 Rename parameters to clarify the definitions.
There are two orthogonal categories for two candidates.

* {primary, secondary}: The primary candidate ranked higher than secondary.
  If the user has configured half-width value as primary, full-width value
  will be secondary.
* {original, alternative}: Original is the candidate that already exists in
  the segment before this rewriter. The original candidate is used as the
  input to this rewriter. Alternative is the candidate that is generated
  from the original candidate.

#codehelath

PiperOrigin-RevId: 722525279
2025-02-03 07:27:00 +00:00
d16473dbcd Update the logic to add a new candidate as a preparation for the next step.
* The behavior should not be changed.
* original_candidate keeps the original value.
* new_candidate takes the alternative value.
* when the original value is not used, this CL will remove the original_candidate instead of replacing the value of the original_candidate.

PiperOrigin-RevId: 722525026
2025-02-03 07:25:00 +00:00
f0019d7af4 Refactoring of GetFormTypesFromStringPair.
The behavior should not be changed.

#codehealth

PiperOrigin-RevId: 722524670
2025-02-03 07:23:06 +00:00
2446710579 Use Util::FormType instead of VariantsRewriter::FormType.
#codehealth

PiperOrigin-RevId: 722524247
2025-02-03 07:21:15 +00:00
63c01793b0 Renamed SessionConverter to EngineConverter
PiperOrigin-RevId: 722524200
2025-02-03 07:20:59 +00:00
a28a1e5268 Change the arguments and return value of GetFormTypesFromStringPair.
Note, std::optional will be removed by the next CL.

#codehealth

PiperOrigin-RevId: 722523797
2025-02-03 07:19:10 +00:00
3b5b6e3d65 Move GetFormTypesFromStringPair to VariantsRewriter
* This function is only used in VariantsRewriter.

#codehealth

PiperOrigin-RevId: 722523319
2025-02-03 07:17:07 +00:00
290d7f16b9 Second trial to remove SessionInterface and SessionHandlerInterface.
Automated g4 rollback of changelist 720933777.

*** Reason for rollback ***

rollback

*** Original change description ***

Automated g4 rollback of changelist 720920580.

*** Reason for rollback ***

TAP has detected 10 or more targets failed to build at cl/720920580.

***

PiperOrigin-RevId: 722489068
2025-02-03 04:31:20 +00:00
4245eb1b19 Fix typos in VariantsRewriter.
#codehealth

PiperOrigin-RevId: 722480365
2025-02-03 03:55:13 +00:00
4d162402bc Remove the dependency to Converter and Segments from EngineInterface.
PiperOrigin-RevId: 721642490
2025-01-31 06:34:40 +00:00
72f08d4ab3 Change EraseExistingCandidates to FindEraseCandidates.
* handle the deletion outside of the loop.
* avoid updating the `rewrite_candidate_infos` in the loop.

#codehealth

PiperOrigin-RevId: 721303332
2025-01-30 09:59:09 +00:00
cbc0dd98fa Stop inserting candidates more than once.
NumberRewriter may be called multiple times in the conversion step.
For example, DictionaryPredictor calls Converter again with Segments
that is already processed before. As result, NumberRewriter is called twice.
However, NumberRewriter should not change Segments twice.

This CL fixes this issue.

#codehealth

PiperOrigin-RevId: 721302816
2025-01-30 09:56:53 +00:00
f698c99746 Refactoring of NumberRewriter
* Change GetRewriteTypeAndBase to GetRewriteCandidateInfo.
* Update tests with modern C++ features.

#codehealth

PiperOrigin-RevId: 721302336
2025-01-30 09:54:46 +00:00
1e581d04c1 Remove session/internal and engien/internal.
Using internal directory is deprecated.

PiperOrigin-RevId: 721271617
2025-01-30 07:58:35 +00:00
ffd9c5d038 Automated g4 rollback of changelist 720920580.
*** Reason for rollback ***

TAP has detected 10 or more targets failed to build at cl/720920580.

*** Original change description ***

Removed SessionInterface and SessionHandlerInteface.

These interfaces are not used. We would like to use Interface when polymorphism is necessary.

***

PiperOrigin-RevId: 720933777
2025-01-29 13:19:22 +00:00
310b28cea0 Removed SessionInterface and SessionHandlerInteface.
These interfaces are not used. We would like to use Interface when polymorphism is necessary.

PiperOrigin-RevId: 720920580
2025-01-29 12:33:24 +00:00
3fb4d00e74 Address clang-tidy warning: constness of local preventing automatic move.
PiperOrigin-RevId: 720909830
2025-01-29 11:52:53 +00:00