4511 Commits

Author SHA1 Message Date
1d4e04604c Introduce the ApplyConversion function.
It executes ImmutableConverter, Rewriters, SuppressionDictionary.
ApplyConversion does not initialize the Segment unlike StartConversion.

#codehealth

PiperOrigin-RevId: 702189619
2024-12-03 05:24:51 +00:00
0f9a2217f0 - Runs Post correction on std::vector<Result> instead of Segments.
- use absl::Span<Result> when no result insertion is required.

PiperOrigin-RevId: 701840700
2024-12-02 06:32:18 +00:00
3c4054ba6f Stop using the pointer of Result. This fix allows to insert new candidates in supplemental model.
PiperOrigin-RevId: 701241583
2024-11-29 11:41:18 +00:00
2b5a6b4d2d Changed the interface from std::vector<Result> * to absl::Span<Result>.
PiperOrigin-RevId: 701184318
2024-11-29 06:50:14 +00:00
006ed69bf5 Fix typos.
PiperOrigin-RevId: 700945320
2024-11-28 09:38:41 +00:00
b81d09b020 Fix issues of build_qt.py.
* Copy include directories to the dest directory for macOS.
* Fix the issue that necessary files are not copied to the dest directory when `qt_dest_dir` is different from `qt_src_dir`.

#codehealth

PiperOrigin-RevId: 700937457
2024-11-28 09:03:29 +00:00
7ee9a7f333 Add stage_ to ConversionRequestBuilder to check the state of the builder.
#codehealth

PiperOrigin-RevId: 700929781
2024-11-28 08:28:33 +00:00
eee56fbf91 Replace use_conversion_segment_key_as_typing_corrected_key with use_already_typing_corrected_key and key().
* ConversionRequest.key() returns the same value as segments.segment(0).key(), as it is initialized so.

PiperOrigin-RevId: 700925429
2024-11-28 08:07:58 +00:00
811b786b94 Fix build errors on GYP.
#codehealth

PiperOrigin-RevId: 700904480
2024-11-28 06:21:45 +00:00
e2079a214c Reranks suffix-dictionary-based zero query suggestions with neutral sentence classifier model.
PiperOrigin-RevId: 700894055
2024-11-28 05:22:11 +00:00
5ab044e2b1 Apply ConversionRequest.key() instead of ComposerData functions.
PiperOrigin-RevId: 700872875
2024-11-28 03:33:08 +00:00
014178c16e Add key to ConversionRequest.
PiperOrigin-RevId: 700872323
2024-11-28 03:29:53 +00:00
13ed550150 Skip recreation of ConversionRequest in StartConversion.
* All ConversionRequest sent to StartConversion must be the CONVERSION type.
* Also simplified the code in IsValidSegments.

PiperOrigin-RevId: 700872045
2024-11-28 03:27:54 +00:00
d99d0d9ae0 Move ReverseConverter to a separate file.
#codehealth

PiperOrigin-RevId: 700694049
2024-11-27 15:23:29 +00:00
86194fb0d0 Extract ReverseConverter from Converter.
* New files for ReverseConverter will be created in the following CLs.

PiperOrigin-RevId: 700647712
2024-11-27 12:12:52 +00:00
bce0fbee88 Move HistoryReconstructor to a separate file.
#codehealth

PiperOrigin-RevId: 700647116
2024-11-27 12:10:26 +00:00
95cfa975b3 Extract HistoryReconstructor from Converter.
* New files for HistoryReconstructor will be created in the following CLs.

PiperOrigin-RevId: 700646425
2024-11-27 12:08:09 +00:00
dc9865e680 Refactor Converter to take Modules in constructor.
* Takes Modules as a const reference instead of a pointer.

PiperOrigin-RevId: 700640302
2024-11-27 11:43:25 +00:00
b72dfc7cc7 Deprecate ImmutableConverterInterface::Convert.
* It is no longer used in the production code.

#codehealth

PiperOrigin-RevId: 700581896
2024-11-27 07:38:32 +00:00
be2c3e702a Fix typo in predictor.h
#codehealth

PiperOrigin-RevId: 700172291
2024-11-26 02:54:46 +00:00
0108eeee0c Update third_party/protobuf to v28.3 2024-11-28 15:02:22 +00:00
51945d7020 Merge Converter::Predict() into StartPrediction.
#codehealth

PiperOrigin-RevId: 699945786
2024-11-25 14:49:38 +00:00
a81137f302 Remove StartSuggestion, StartPartialPrediction, and StartPartialSuggestion from ConverterInterface.
* Use StartPrediction covers all functionality.
* ConversionRequest::RequestType controls the behavior.

For example, instead of using StartPartialSuggestion, please use StartPrediction with ConversionRequest with RequestType set to PARTIAL_SUGGESTION.

Before:
const ConversionRequest convreq = ConversionRequestBuilder()
    ...
    .Build();
converter.StartPartialSuggestion(convreq, *segment);

After:
const ConversionRequest convreq = ConversionRequestBuilder()
    .SetRequestType(ConversionRequest::PARTIAL_SUGGESTION)
    ....
    .Build();
converter.StartPrediction(convreq, *segment);
PiperOrigin-RevId: 699945320
2024-11-25 14:49:19 +00:00
ef3688d585 Use StartPrediction() for all suggestion/prediction requests.
* Other suggestion/prediction functions will be removed in the following CLs.
* Added DCHECK to validate the ConversionRequest::RequestType.
* Updated unit tests to set ConversionRequest::RequestType to align with the production behavior.

PiperOrigin-RevId: 699944808
2024-11-25 14:49:01 +00:00
b664ed66d7 Split ExitTemporaryAlphanumModeAfterCommittingSugesstion to three tests.
* This is a preparation to merge Prediction/Suggestion functions in Converter.
* Clarify the output of StartSuggestion.

#codehealth

PiperOrigin-RevId: 699944402
2024-11-25 14:48:41 +00:00
bf19123dc1 Remove max_history_size from ConversionPreferences.
* This value is actually always overwritten by Converter::SetKey.

#codehealth

PiperOrigin-RevId: 699938273
2024-11-25 14:48:23 +00:00
fe67ed97c6 Remove has_composer_ from ConversionRequest.
* The ComposerData object is always available.
* If it's not initialized (in unit tests), an empty ComposerData is returned.
* ConversionRequest::Options is preferred to change the behavior.

PiperOrigin-RevId: 699937472
2024-11-25 14:48:02 +00:00
5c3fea55e0 Remove has_composer() from UserHistoryPredictor and DictionaryPredictionAggregator.
* Composer is always set in ConversionRequest.
* Updated the unit tests for UserHistoryPredictor to align with the actual behaviors.

PiperOrigin-RevId: 699937176
2024-11-25 14:47:31 +00:00
fa4ea5606e Use use_conversion_segment_key_as_typing_corrected_key instead of reset_composer().
PiperOrigin-RevId: 699936816
2024-11-25 14:46:59 +00:00
b9d1c47842 Simplify the functions in Converter.
* Merged Converter() into StartConversion().
* Removed the argument of `key` from Predict().
* This is a preparation for updates with ConversionRequest in following CLs.

#codehealth

PiperOrigin-RevId: 699936135
2024-11-25 14:46:29 +00:00
4a9ff1659d Remove the WithKey functions from ConverterInterface.
* These methods are not used in production code.
* This is a preparation for updates with ConversionRequest in following CLs.

#codehealth

PiperOrigin-RevId: 699935170
2024-11-25 14:46:03 +00:00
480015f51b Remove the deprecated constructor of ConversionRequest.
#codehealth

PiperOrigin-RevId: 699909642
2024-11-25 14:45:37 +00:00
3c6d44b63a Reduce the usage of ConversionRequest::has_composer().
* the composer object is always available.
* if has_composer() returns false, composer() returns an empty ComposerData.
* This is a preparation to remove ConversionRequest::has_composer().

#codehealth

PiperOrigin-RevId: 699909262
2024-11-25 14:45:09 +00:00
dfaee49653 Remove should_call_set_key_in_prediction from ConversionRequest.
* This option is no longer used.
* Introduced by cl/439764986 and removed the actual code by cl/491812431

#codehealth

PiperOrigin-RevId: 699908792
2024-11-25 14:44:42 +00:00
220bbc4a78 Remove set_request_type() from ConversionRequest
* Add SetRequestType to ConversionRequestBuilder.

PiperOrigin-RevId: 699908267
2024-11-25 14:44:15 +00:00
32285b0309 Remove set_should_call_set_key_in_prediction() and set_kana_modifier_insensitive_conversion() from ConversionRequest.
* Other setters will be removed in the following CLs.
* ConversionRequest::Options is the alternative of the setters.

PiperOrigin-RevId: 699904988
2024-11-25 14:43:48 +00:00
f2e774b538 Remove set_max_user_history_prediction_candidates_size_for_zero_query() and set_max_dictionary_prediction_candidates_size() from CandidateRequest.
* Other setters will be removed in the following CLs.
* ConversionRequest::Options is the alternative of the setters.

PiperOrigin-RevId: 699904449
2024-11-25 14:43:22 +00:00
d21e87d8ff Remove set_max_user_history_prediction_candidates_size() from ConversionRequest.
* Other setters will be removed in the following CLs.
* ConversionRequest::Options is the alternative of the setters.

PiperOrigin-RevId: 699896399
2024-11-25 14:42:54 +00:00
fa9533ef65 Disallow Mozc to be installed on ARM64 Windows (#1128)
Before Mozc becomes available to ARM64 processes in Windows, let's
disallow Mozc64.msi to be installed into ARM64 Windows machines to avoid
unnecessary user confusions.

Note that this commit only blocks the initial installation. There is no
behavior change for those who have already installed Mozc into their
ARM64 Windows environments. This means that both upgrading from a
previous version of Mozc and uninstalling Mozc continue to be allowed.

Closes #1127.

PiperOrigin-RevId: 699710858
2024-11-25 02:08:26 +09:00
dfa0af777c Remove set_max_conversion_candidates_size() from ConversionRequest.
* Other setters will be removed in the following CLs.
* ConversionRequest::Options is the alternative of the setters.

PiperOrigin-RevId: 699147655
2024-11-24 15:00:41 +00:00
7b2e7cf31e Remove set_composer_key_selection and set_skip_slow_rewriters from ConversionRequest.
* Other setters will be removed in the following CLs.
* ConversionRequest::Options is the alternative of the setters.

PiperOrigin-RevId: 699111673
2024-11-24 15:00:21 +00:00
9e72a5a14d Make ConversionRequest const in user_segment_history_rewriter_test.cc.
#codehealth

PiperOrigin-RevId: 699111358
2024-11-24 15:00:00 +00:00
1c5ab53ff4 Remove set_enable_user_history_for_conversion() from ConversionRequest.
* Other setters will be removed in the following CLs.
* ConversionRequest::Options is the alternative of the setters.

PiperOrigin-RevId: 699110965
2024-11-24 14:59:41 +00:00
6ff88de248 Remove set_create_partial_candidates from ConversionRequest.
* Other setters will be removed in the following CLs.
* ConversionRequest::Options is the alternative of the setters.

PiperOrigin-RevId: 699110607
2024-11-24 14:59:23 +00:00
0d309fda06 Remove set_use_actual_converter_for_realtime_conversion from ConversionRequest.
* Other setters will be removed in the following CLs.

PiperOrigin-RevId: 699110215
2024-11-24 14:59:06 +00:00
dc174df742 Add a constructor to ConversionRequest that takes Options.
* Updated Session with the new constructor of ConversionRequest.

PiperOrigin-RevId: 699109690
2024-11-24 14:58:47 +00:00
9ea709c1b6 Remove --use_actual_converter_for_realtime_conversion flag
* This flag is always true.

#codehealth

PiperOrigin-RevId: 699109098
2024-11-24 14:58:28 +00:00
6f77d12884 Rename Params to Options in ConversionRequest.
* To clarify the difference from decoder_experiment_params.
* Applied formatter.

#codehealth

PiperOrigin-RevId: 699108600
2024-11-24 14:58:09 +00:00
886fff85d8 Change the type of context from pointer to reference in ConversionRequest.
PiperOrigin-RevId: 699108105
2024-11-24 14:57:50 +00:00
6b736570c6 Add words of sports teams.
* Follow-up to the discussion in cl/696491748.

#typingquality

PiperOrigin-RevId: 699071399
2024-11-24 14:57:30 +00:00