# Copyright 2010-2021, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#     * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
#     * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# Visibility:  please choose a more appropriate default for the package,
# and update any rules that should be different.

load(
    "//:build_defs.bzl",
    "mozc_cc_binary",
    "mozc_cc_library",
    "mozc_cc_test",
    "mozc_py_binary",
    "mozc_select_enable_usage_rewriter",
)

package(default_visibility = ["//visibility:private"])

mozc_cc_library(
    name = "rewriter_interface",
    textual_hdrs = ["rewriter_interface.h"],
    visibility = [
        "//converter:__pkg__",
        "//engine:__pkg__",
    ],
    deps = [
        "//converter:segments",
        "//request:conversion_request",
    ],
)

mozc_cc_test(
    name = "merger_rewriter_test",
    size = "small",
    srcs = ["merger_rewriter_test.cc"],
    deps = [
        ":merger_rewriter",
        ":rewriter_interface",
        "//converter:segments",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "//testing:gunit_main",
        "//testing:mozctest",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_library(
    name = "collocation_rewriter",
    srcs = [
        "collocation_rewriter.cc",
    ],
    hdrs = ["collocation_rewriter.h"],
    deps = [
        ":collocation_util",
        ":rewriter_interface",
        "//base:util",
        "//base:vlog",
        "//converter:attribute",
        "//converter:segments",
        "//data_manager",
        "//dictionary:pos_matcher",
        "//request:conversion_request",
        "//storage:existence_filter",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:span",
    ],
    alwayslink = 1,
)

mozc_cc_test(
    name = "collocation_rewriter_test",
    srcs = ["collocation_rewriter_test.cc"],
    deps = [
        ":collocation_rewriter",
        "//converter:segments",
        "//data_manager/testing:mock_data_manager",
        "//dictionary:pos_matcher",
        "//request:conversion_request",
        "//testing:gunit_main",
        "//testing:mozctest",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/types:span",
    ],
)

mozc_cc_library(
    name = "user_segment_history_rewriter",
    srcs = ["user_segment_history_rewriter.cc"],
    hdrs = ["user_segment_history_rewriter.h"],
    deps = [
        ":rewriter_interface",
        ":variants_rewriter",
        "//base:config_file_stream",
        "//base:file_util",
        "//base:number_util",
        "//base:util",
        "//base:vlog",
        "//config:character_form_manager",
        "//converter:attribute",
        "//converter:segments",
        "//dictionary:pos_group",
        "//dictionary:pos_matcher",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "//storage:lru_cache",
        "//storage:lru_storage",
        "//transliteration",
        "@com_google_absl//absl/container:btree",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:span",
    ],
    alwayslink = 1,
)

mozc_cc_test(
    name = "user_segment_history_rewriter_test",
    size = "small",
    timeout = "moderate",
    srcs = ["user_segment_history_rewriter_test.cc"],
    deps = [
        ":number_rewriter",
        ":user_segment_history_rewriter",
        ":variants_rewriter",
        "//base:clock",
        "//base:clock_mock",
        "//base:file_util",
        "//base:number_util",
        "//base:system_util",
        "//config:character_form_manager",
        "//config:config_handler",
        "//converter:attribute",
        "//converter:inner_segment",
        "//converter:segments",
        "//data_manager/testing:mock_data_manager",
        "//dictionary:pos_group",
        "//dictionary:pos_matcher",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "//request:request_test_util",
        "//testing:gunit_main",
        "//testing:mozctest",
        "//testing:test_peer",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/random",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/time",
    ],
)

mozc_cc_library(
    name = "user_boundary_history_rewriter",
    srcs = ["user_boundary_history_rewriter.cc"],
    hdrs = ["user_boundary_history_rewriter.h"],
    deps = [
        ":rewriter_interface",
        "//base:config_file_stream",
        "//base:file_util",
        "//base:vlog",
        "//converter:segments",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "//storage:lru_storage",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
    alwayslink = 1,
)

mozc_cc_test(
    name = "user_boundary_history_rewriter_test",
    size = "small",
    srcs = ["user_boundary_history_rewriter_test.cc"],
    deps = [
        ":rewriter_interface",
        ":user_boundary_history_rewriter",
        "//base:file_util",
        "//base:system_util",
        "//config:config_handler",
        "//converter:segments",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "//testing:gunit_main",
        "//testing:mozctest",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:span",
    ],
)

mozc_cc_library(
    name = "date_rewriter",
    srcs = ["date_rewriter.cc"],
    hdrs = ["date_rewriter.h"],
    visibility = ["//converter:__pkg__"],
    deps = [
        ":rewriter_interface",
        "//base:clock",
        "//base:japanese_util",
        "//base:number_util",
        "//base:util",
        "//base:vlog",
        "//base/strings:unicode",
        "//composer",
        "//converter:attribute",
        "//converter:segments",
        "//dictionary:dictionary_interface",
        "//dictionary:dictionary_token",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "@com_google_absl//absl/algorithm:container",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_absl//absl/time",
        "@com_google_absl//absl/types:span",
    ],
    alwayslink = 1,
)

mozc_cc_test(
    name = "date_rewriter_test",
    size = "small",
    srcs = ["date_rewriter_test.cc"],
    deps = [
        ":date_rewriter",
        ":rewriter_interface",
        "//base:clock",
        "//base:clock_mock",
        "//base:util",
        "//composer",
        "//composer:table",
        "//converter:converter_mock",
        "//converter:segments",
        "//converter:segments_matchers",
        "//dictionary:dictionary_interface",
        "//dictionary:dictionary_mock",
        "//dictionary:dictionary_token",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "//testing:gunit_main",
        "//testing:mozctest",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_library(
    name = "number_rewriter",
    srcs = [
        "number_rewriter.cc",
    ],
    hdrs = ["number_rewriter.h"],
    deps = [
        ":number_compound_util",
        ":rewriter_interface",
        "//base:japanese_util",
        "//base:number_util",
        "//base:util",
        "//base:vlog",
        "//base/container:serialized_string_array",
        "//config:character_form_manager",
        "//converter:attribute",
        "//converter:segments",
        "//data_manager",
        "//dictionary:pos_matcher",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:span",
    ],
    alwayslink = 1,
)

mozc_cc_test(
    name = "number_rewriter_test",
    size = "small",
    timeout = "moderate",
    srcs = ["number_rewriter_test.cc"],
    deps = [
        ":number_rewriter",
        ":rewriter_interface",
        "//base:number_util",
        "//base/strings:assign",
        "//config:character_form_manager",
        "//converter:attribute",
        "//converter:segments",
        "//converter:segments_matchers",
        "//data_manager/testing:mock_data_manager",
        "//dictionary:pos_matcher",
        "//protocol:commands_cc_proto",
        "//request:conversion_request",
        "//request:request_test_util",
        "//testing:gunit_main",
        "//testing:mozctest",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
    ],
)

mozc_cc_library(
    name = "small_letter_rewriter",
    srcs = ["small_letter_rewriter.cc"],
    hdrs = ["small_letter_rewriter.h"],
    deps = [
        ":rewriter_interface",
        "//base:util",
        "//converter:attribute",
        "//converter:segments",
        "//protocol:commands_cc_proto",
        "//request:conversion_request",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
    ],
    alwayslink = 1,
)

mozc_cc_test(
    name = "small_letter_rewriter_test",
    size = "small",
    srcs = ["small_letter_rewriter_test.cc"],
    deps = [
        ":rewriter_interface",
        ":small_letter_rewriter",
        "//base/strings:assign",
        "//converter:segments",
        "//engine",
        "//engine:mock_data_engine_factory",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "//testing:gunit_main",
        "//testing:mozctest",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_library(
    name = "transliteration_rewriter",
    srcs = [
        "transliteration_rewriter.cc",
    ],
    hdrs = ["transliteration_rewriter.h"],
    visibility = [
        "//session:__pkg__",
    ],
    deps = [
        ":rewriter_interface",
        "//base:japanese_util",
        "//base:number_util",
        "//base:text_normalizer",
        "//base:util",
        "//composer",
        "//converter:attribute",
        "//converter:segments",
        "//dictionary:pos_matcher",
        "//protocol:commands_cc_proto",
        "//request:conversion_request",
        "//transliteration",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:span",
    ],
    alwayslink = 1,
)

mozc_cc_test(
    name = "transliteration_rewriter_test",
    size = "small",
    timeout = "moderate",
    srcs = ["transliteration_rewriter_test.cc"],
    deps = [
        ":rewriter_interface",
        ":transliteration_rewriter",
        "//composer",
        "//composer:table",
        "//config:config_handler",
        "//converter:segments",
        "//data_manager/testing:mock_data_manager",
        "//dictionary:pos_matcher",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "//request:request_test_util",
        "//testing:gunit_main",
        "//testing:mozctest",
        "//transliteration",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
    ],
)

mozc_cc_library(
    name = "language_aware_rewriter",
    srcs = [
        "language_aware_rewriter.cc",
    ],
    hdrs = ["language_aware_rewriter.h"],
    deps = [
        ":rewriter_interface",
        "//base:japanese_util",
        "//base:util",
        "//composer",
        "//converter:attribute",
        "//converter:segments",
        "//dictionary:dictionary_interface",
        "//dictionary:pos_matcher",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings:string_view",
    ],
)

mozc_cc_test(
    name = "language_aware_rewriter_test",
    size = "small",
    srcs = ["language_aware_rewriter_test.cc"],
    deps = [
        ":language_aware_rewriter",
        ":rewriter_interface",
        "//composer",
        "//composer:table",
        "//converter:attribute",
        "//converter:segments",
        "//converter:segments_matchers",
        "//data_manager/testing:mock_data_manager",
        "//dictionary:dictionary_mock",
        "//dictionary:pos_matcher",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "//testing:gunit_main",
        "//testing:mozctest",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_library(
    name = "version_rewriter",
    srcs = ["version_rewriter.cc"],
    hdrs = ["version_rewriter.h"],
    deps = [
        ":rewriter_interface",
        "//base:const",
        "//base:version",
        "//converter:attribute",
        "//converter:segments",
        "//protocol:commands_cc_proto",
        "//request:conversion_request",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/strings",
    ],
    alwayslink = 1,
)

mozc_cc_test(
    name = "version_rewriter_test",
    size = "small",
    srcs = ["version_rewriter_test.cc"],
    deps = [
        ":rewriter_interface",
        ":version_rewriter",
        "//converter:segments",
        "//protocol:commands_cc_proto",
        "//request:conversion_request",
        "//testing:gunit_main",
        "//testing:mozctest",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_library(
    name = "symbol_rewriter",
    srcs = ["symbol_rewriter.cc"],
    hdrs = ["symbol_rewriter.h"],
    deps = [
        ":rewriter_interface",
        ":rewriter_util",
        "//base:japanese_util",
        "//base:util",
        "//base:vlog",
        "//base/strings:assign",
        "//converter:attribute",
        "//converter:segments",
        "//data_manager",
        "//data_manager:serialized_dictionary",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "@com_google_absl//absl/algorithm:container",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
    ],
    alwayslink = 1,
)

mozc_cc_test(
    name = "symbol_rewriter_test",
    size = "small",
    timeout = "moderate",
    srcs = ["symbol_rewriter_test.cc"],
    deps = [
        ":rewriter_interface",
        ":symbol_rewriter",
        "//base:util",
        "//converter:inner_segment",
        "//converter:segments",
        "//data_manager/testing:mock_data_manager",
        "//protocol:commands_cc_proto",
        "//request:conversion_request",
        "//request:request_test_util",
        "//testing:gunit_main",
        "//testing:mozctest",
        "//testing:test_peer",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_library(
    name = "emoticon_rewriter",
    srcs = ["emoticon_rewriter.cc"],
    hdrs = ["emoticon_rewriter.h"],
    deps = [
        ":rewriter_interface",
        ":rewriter_util",
        "//base:vlog",
        "//converter:attribute",
        "//converter:segments",
        "//data_manager",
        "//data_manager:serialized_dictionary",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/random",
        "@com_google_absl//absl/strings",
    ],
    alwayslink = 1,
)

mozc_cc_test(
    name = "emoticon_rewriter_test",
    size = "small",
    srcs = ["emoticon_rewriter_test.cc"],
    deps = [
        ":emoticon_rewriter",
        ":rewriter_interface",
        "//config:config_handler",
        "//converter:segments",
        "//data_manager/testing:mock_data_manager",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "//testing:gunit_main",
        "//testing:mozctest",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_library(
    name = "variants_rewriter",
    srcs = ["variants_rewriter.cc"],
    hdrs = ["variants_rewriter.h"],
    deps = [
        ":rewriter_interface",
        "//base:japanese_util",
        "//base:number_util",
        "//base:util",
        "//base:vlog",
        "//base/strings:unicode",
        "//config:character_form_manager",
        "//converter:attribute",
        "//converter:inner_segment",
        "//converter:segments",
        "//dictionary:pos_matcher",
        "//protocol:commands_cc_proto",
        "//request:conversion_request",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
    ],
    alwayslink = 1,
)

mozc_cc_test(
    name = "variants_rewriter_test",
    size = "small",
    srcs = ["variants_rewriter_test.cc"],
    deps = [
        ":rewriter_interface",
        ":variants_rewriter",
        "//base:japanese_util",
        "//base:number_util",
        "//base:util",
        "//config:character_form_manager",
        "//converter:attribute",
        "//converter:inner_segment",
        "//converter:segments",
        "//data_manager/testing:mock_data_manager",
        "//dictionary:pos_matcher",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "//testing:gunit_main",
        "//testing:mozctest",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_library(
    name = "english_variants_rewriter",
    srcs = ["english_variants_rewriter.cc"],
    hdrs = ["english_variants_rewriter.h"],
    deps = [
        ":rewriter_interface",
        "//base:util",
        "//converter:attribute",
        "//converter:segments",
        "//dictionary:pos_matcher",
        "//protocol:commands_cc_proto",
        "//request:conversion_request",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
    ],
    alwayslink = 1,
)

mozc_cc_test(
    name = "english_variants_rewriter_test",
    size = "small",
    srcs = ["english_variants_rewriter_test.cc"],
    deps = [
        ":english_variants_rewriter",
        ":rewriter_interface",
        "//converter:attribute",
        "//converter:segments",
        "//data_manager/testing:mock_data_manager",
        "//dictionary:pos_matcher",
        "//protocol:commands_cc_proto",
        "//request:conversion_request",
        "//testing:gunit_main",
        "//testing:mozctest",
        "//testing:test_peer",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_library(
    name = "fortune_rewriter",
    srcs = ["fortune_rewriter.cc"],
    hdrs = ["fortune_rewriter.h"],
    deps = [
        ":rewriter_interface",
        "//base:clock",
        "//base:singleton",
        "//converter:attribute",
        "//converter:segments",
        "//request:conversion_request",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/random",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/time",
    ],
    alwayslink = 1,
)

mozc_cc_test(
    name = "fortune_rewriter_test",
    size = "small",
    srcs = ["fortune_rewriter_test.cc"],
    deps = [
        ":fortune_rewriter",
        "//converter:segments",
        "//request:conversion_request",
        "//testing:gunit_main",
        "//testing:mozctest",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_library(
    name = "dice_rewriter",
    srcs = ["dice_rewriter.cc"],
    hdrs = ["dice_rewriter.h"],
    deps = [
        ":rewriter_interface",
        "//converter:attribute",
        "//converter:segments",
        "//request:conversion_request",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/random",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_absl//absl/strings:string_view",
    ],
    alwayslink = 1,
)

mozc_cc_test(
    name = "dice_rewriter_test",
    size = "small",
    srcs = ["dice_rewriter_test.cc"],
    deps = [
        ":dice_rewriter",
        "//converter:segments",
        "//request:conversion_request",
        "//testing:gunit_main",
        "//testing:mozctest",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_library(
    name = "calculator_rewriter",
    srcs = ["calculator_rewriter.cc"],
    hdrs = ["calculator_rewriter.h"],
    deps = [
        ":rewriter_interface",
        "//base:japanese_util",
        "//base:util",
        "//converter:attribute",
        "//converter:segments",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "//rewriter/calculator",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
    ],
    alwayslink = 1,
)

mozc_cc_test(
    name = "calculator_rewriter_test",
    size = "small",
    timeout = "moderate",
    srcs = ["calculator_rewriter_test.cc"],
    deps = [
        ":calculator_rewriter",
        ":rewriter_interface",
        "//config:config_handler",
        "//converter:attribute",
        "//converter:segments",
        "//converter:segments_matchers",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "//rewriter/calculator",
        "//testing:gunit_main",
        "//testing:mozctest",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_library(
    name = "unicode_rewriter",
    srcs = ["unicode_rewriter.cc"],
    hdrs = ["unicode_rewriter.h"],
    deps = [
        ":rewriter_interface",
        "//base:util",
        "//composer",
        "//converter:attribute",
        "//converter:segments",
        "//request:conversion_request",
        "@com_google_absl//absl/algorithm:container",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
    ],
    alwayslink = 1,
)

mozc_cc_test(
    name = "unicode_rewriter_test",
    size = "small",
    timeout = "moderate",
    srcs = ["unicode_rewriter_test.cc"],
    deps = [
        ":rewriter_interface",
        ":unicode_rewriter",
        "//composer",
        "//converter:attribute",
        "//converter:segments",
        "//engine",
        "//engine:mock_data_engine_factory",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "//testing:gunit_main",
        "//testing:mozctest",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
    ],
)

mozc_cc_library(
    name = "user_dictionary_rewriter",
    srcs = ["user_dictionary_rewriter.cc"],
    hdrs = ["user_dictionary_rewriter.h"],
    deps = [
        ":rewriter_interface",
        "//converter:attribute",
        "//converter:segments",
        "//request:conversion_request",
        "@com_google_absl//absl/log:check",
    ],
    alwayslink = 1,
)

mozc_cc_test(
    name = "user_dictionary_rewriter_test",
    size = "small",
    srcs = ["user_dictionary_rewriter_test.cc"],
    deps = [
        ":user_dictionary_rewriter",
        "//converter:attribute",
        "//converter:segments",
        "//request:conversion_request",
        "//testing:gunit_main",
        "//testing:mozctest",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_library(
    name = "dictionary_generator",
    srcs = [
        "dictionary_generator.cc",
    ],
    hdrs = ["dictionary_generator.h"],
    deps = [
        "//data_manager",
        "//dictionary:pos_matcher",
        "//dictionary:user_pos",
        "@com_google_absl//absl/container:btree",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_absl//absl/strings:string_view",
    ],
)

mozc_cc_test(
    name = "dictionary_generator_test",
    size = "small",
    srcs = ["dictionary_generator_test.cc"],
    deps = [
        ":dictionary_generator",
        "//data_manager/testing:mock_data_manager",
        "//dictionary:pos_matcher",
        "//dictionary:user_pos",
        "//testing:gunit_main",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_binary(
    name = "gen_symbol_rewriter_dictionary_main",
    srcs = ["gen_symbol_rewriter_dictionary_main.cc"],
    visibility = [
        "//:__subpackages__",
        "//data_manager:__subpackages__",
    ],
    deps = [
        ":dictionary_generator",
        "//base:file_stream",
        "//base:init_mozc_buildtool",
        "//base:util",
        "//base:vlog",
        "//base/file:temp_dir",
        "//base/strings:japanese",
        "//base/strings:unicode",
        "//data_manager",
        "//data_manager:serialized_dictionary",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:span",
    ],
)

mozc_cc_binary(
    name = "gen_emoticon_rewriter_data",
    srcs = ["gen_emoticon_rewriter_data.cc"],
    visibility = ["//data_manager:__subpackages__"],
    deps = [
        "//base:file_stream",
        "//base:init_mozc_buildtool",
        "//data_manager:serialized_dictionary",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
    ],
)

mozc_py_binary(
    name = "gen_emoji_rewriter_data",
    srcs = ["gen_emoji_rewriter_data.py"],
    visibility = ["//data_manager:__subpackages__"],
    deps = [
        "//build_tools:code_generator_util",
        "//build_tools:serialized_string_array_builder",
    ],
)

mozc_cc_library(
    name = "emoji_rewriter",
    srcs = ["emoji_rewriter.cc"],
    hdrs = ["emoji_rewriter.h"],
    deps = [
        ":rewriter_interface",
        ":rewriter_util",
        "//base:japanese_util",
        "//base:vlog",
        "//base/container:serialized_string_array",
        "//base/strings:assign",
        "//converter:attribute",
        "//converter:segments",
        "//data_manager",
        "//data_manager:emoji_data",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
    ],
    alwayslink = 1,
)

mozc_cc_test(
    name = "emoji_rewriter_test",
    size = "small",
    timeout = "moderate",
    srcs = ["emoji_rewriter_test.cc"],
    deps = [
        ":emoji_rewriter",
        ":rewriter_interface",
        ":variants_rewriter",
        "//base/container:serialized_string_array",
        "//config:config_handler",
        "//converter:segments",
        "//data_manager:emoji_data",
        "//data_manager/testing:mock_data_manager",
        "//dictionary:pos_matcher",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "//testing:gunit_main",
        "//testing:mozctest",
        "@com_google_absl//absl/container:btree",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_library(
    name = "single_kanji_rewriter",
    srcs = ["single_kanji_rewriter.cc"],
    hdrs = ["single_kanji_rewriter.h"],
    deps = [
        ":rewriter_interface",
        ":rewriter_util",
        "//base:vlog",
        "//base/strings:assign",
        "//converter:attribute",
        "//converter:segments",
        "//data_manager:serialized_dictionary",
        "//dictionary:pos_matcher",
        "//dictionary:single_kanji_dictionary",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:span",
    ],
    alwayslink = 1,
)

mozc_py_binary(
    name = "gen_single_kanji_rewriter_data",
    srcs = ["gen_single_kanji_rewriter_data.py"],
    visibility = ["//data_manager:__subpackages__"],
    deps = [
        "//build_tools:code_generator_util",
        "//build_tools:serialized_string_array_builder",
    ],
)

mozc_cc_binary(
    name = "gen_single_kanji_noun_prefix_data",
    srcs = ["gen_single_kanji_noun_prefix_data.cc"],
    visibility = ["//data_manager:__subpackages__"],
    deps = [
        "//base:init_mozc_buildtool",
        "//data_manager:serialized_dictionary",
        "@com_google_absl//absl/flags:flag",
    ],
)

mozc_cc_test(
    name = "single_kanji_rewriter_test",
    size = "small",
    srcs = ["single_kanji_rewriter_test.cc"],
    deps = [
        ":rewriter_interface",
        ":single_kanji_rewriter",
        "//converter:segments",
        "//data_manager/testing:mock_data_manager",
        "//dictionary:pos_matcher",
        "//engine:modules",
        "//protocol:commands_cc_proto",
        "//request:conversion_request",
        "//request:request_test_util",
        "//testing:gunit_main",
        "//testing:mozctest",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
    ],
)

mozc_py_binary(
    name = "gen_counter_suffix_array",
    srcs = ["gen_counter_suffix_array.py"],
    visibility = [
        "//:__subpackages__",
        "//data_manager:__subpackages__",
    ],
    deps = [
        "//build_tools:code_generator_util",
        "//build_tools:serialized_string_array_builder",
    ],
)

mozc_cc_library(
    name = "focus_candidate_rewriter",
    srcs = [
        "focus_candidate_rewriter.cc",
    ],
    hdrs = ["focus_candidate_rewriter.h"],
    deps = [
        ":number_compound_util",
        ":rewriter_interface",
        "//base:number_util",
        "//base:util",
        "//base:vlog",
        "//base/container:serialized_string_array",
        "//converter:segments",
        "//data_manager",
        "//dictionary:pos_matcher",
        "//request:conversion_request",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_test(
    name = "focus_candidate_rewriter_test",
    size = "small",
    srcs = ["focus_candidate_rewriter_test.cc"],
    deps = [
        ":focus_candidate_rewriter",
        ":rewriter_interface",
        "//base:number_util",
        "//converter:segments",
        "//data_manager/testing:mock_data_manager",
        "//testing:gunit_main",
        "//testing:mozctest",
        "//transliteration",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_library(
    name = "zipcode_rewriter",
    srcs = [
        "zipcode_rewriter.cc",
    ],
    hdrs = ["zipcode_rewriter.h"],
    deps = [
        ":rewriter_interface",
        "//converter:attribute",
        "//converter:segments",
        "//dictionary:pos_matcher",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
    ],
    alwayslink = 1,
)

mozc_cc_test(
    name = "zipcode_rewriter_test",
    size = "small",
    srcs = [
        "zipcode_rewriter_test.cc",
    ],
    deps = [
        ":zipcode_rewriter",
        "//converter:segments",
        "//data_manager/testing:mock_data_manager",
        "//dictionary:pos_matcher",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "//testing:gunit_main",
        "//testing:mozctest",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_library(
    name = "t13n_promotion_rewriter",
    srcs = ["t13n_promotion_rewriter.cc"],
    hdrs = ["t13n_promotion_rewriter.h"],
    deps = [
        ":rewriter_interface",
        ":rewriter_util",
        "//base:util",
        "//composer",
        "//converter:segments",
        "//protocol:commands_cc_proto",
        "//request:conversion_request",
        "//transliteration",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/strings",
    ],
    alwayslink = 1,
)

mozc_cc_test(
    name = "t13n_promotion_rewriter_test",
    size = "small",
    srcs = ["t13n_promotion_rewriter_test.cc"],
    deps = [
        ":rewriter_interface",
        ":t13n_promotion_rewriter",
        ":transliteration_rewriter",
        "//composer",
        "//config:config_handler",
        "//converter:segments",
        "//data_manager/testing:mock_data_manager",
        "//dictionary:pos_matcher",
        "//protocol:commands_cc_proto",
        "//request:conversion_request",
        "//request:request_test_util",
        "//testing:gunit_main",
        "//testing:mozctest",
        "//transliteration",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_library(
    name = "command_rewriter",
    srcs = ["command_rewriter.cc"],
    hdrs = ["command_rewriter.h"],
    deps = [
        ":rewriter_interface",
        "//converter:attribute",
        "//converter:segments",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "@com_google_absl//absl/algorithm:container",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:span",
    ],
)

mozc_cc_test(
    name = "command_rewriter_test",
    size = "small",
    srcs = ["command_rewriter_test.cc"],
    deps = [
        ":command_rewriter",
        "//config:config_handler",
        "//converter:attribute",
        "//converter:segments",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "//testing:gunit_main",
        "//testing:mozctest",
    ],
)

mozc_cc_library(
    name = "environmental_filter_rewriter",
    srcs = ["environmental_filter_rewriter.cc"],
    hdrs = ["environmental_filter_rewriter.h"],
    deps = [
        ":rewriter_interface",
        "//base:text_normalizer",
        "//base:util",
        "//base/container:serialized_string_array",
        "//converter:attribute",
        "//converter:segments",
        "//data_manager",
        "//data_manager:emoji_data",
        "//protocol:commands_cc_proto",
        "//request:conversion_request",
        "@com_google_absl//absl/algorithm:container",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:span",
    ],
)

mozc_cc_test(
    name = "environmental_filter_rewriter_test",
    size = "small",
    srcs = ["environmental_filter_rewriter_test.cc"],
    deps = [
        ":emoji_rewriter",
        ":environmental_filter_rewriter",
        "//base:text_normalizer",
        "//base:util",
        "//base/container:serialized_string_array",
        "//converter:attribute",
        "//converter:segments",
        "//data_manager:emoji_data",
        "//data_manager/testing:mock_data_manager",
        "//protocol:commands_cc_proto",
        "//request:conversion_request",
        "//testing:gunit_main",
        "//testing:mozctest",
        "@com_google_absl//absl/container:btree",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:span",
    ],
)

mozc_cc_library(
    name = "remove_redundant_candidate_rewriter",
    srcs = ["remove_redundant_candidate_rewriter.cc"],
    hdrs = ["remove_redundant_candidate_rewriter.h"],
    deps = [
        ":rewriter_interface",
        "//converter:segments",
        "//protocol:commands_cc_proto",
        "//request:conversion_request",
    ],
)

mozc_cc_test(
    name = "remove_redundant_candidate_rewriter_test",
    size = "small",
    timeout = "moderate",
    srcs = ["remove_redundant_candidate_rewriter_test.cc"],
    deps = [
        ":remove_redundant_candidate_rewriter",
        ":rewriter_interface",
        "//converter:segments",
        "//protocol:commands_cc_proto",
        "//request:conversion_request",
        "//testing:gunit_main",
    ],
)

mozc_cc_binary(
    name = "gen_usage_rewriter_dictionary_main",
    srcs = ["gen_usage_rewriter_dictionary_main.cc"],
    visibility = ["//data_manager:__subpackages__"],
    deps = [
        "//base:file_stream",
        "//base:init_mozc_buildtool",
        "//base/container:serialized_string_array",
        "@com_google_absl//absl/container:btree",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:span",
    ],
)

mozc_cc_library(
    name = "usage_rewriter",
    srcs = ["usage_rewriter.cc"],
    hdrs = ["usage_rewriter.h"],
    target_compatible_with = mozc_select_enable_usage_rewriter(
        off = ["@platforms//:incompatible"],
    ),
    deps = [
        ":rewriter_interface",
        "//base:util",
        "//base:vlog",
        "//base/container:serialized_string_array",
        "//converter:segments",
        "//data_manager",
        "//dictionary:dictionary_interface",
        "//dictionary:pos_matcher",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_test(
    name = "usage_rewriter_test",
    size = "small",
    srcs = ["usage_rewriter_test.cc"],
    tags = ["noandroid"],
    target_compatible_with = mozc_select_enable_usage_rewriter(
        off = ["@platforms//:incompatible"],
    ),
    deps = [
        ":rewriter_interface",
        ":usage_rewriter",
        "//base/container:serialized_string_array",
        "//config:config_handler",
        "//converter:segments",
        "//data_manager/testing:mock_data_manager",
        "//dictionary:pos_matcher",
        "//dictionary:user_dictionary",
        "//dictionary:user_dictionary_storage",
        "//dictionary:user_pos",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//protocol:user_dictionary_storage_cc_proto",
        "//request:conversion_request",
        "//testing:gunit_main",
        "//testing:mozctest",
        "//testing:test_peer",
        "@com_google_absl//absl/strings",
    ],
)

mozc_py_binary(
    name = "gen_reading_correction_data",
    srcs = ["gen_reading_correction_data.py"],
    visibility = [
        "//:__subpackages__",
        "//data_manager:__subpackages__",
    ],
    deps = [
        "//build_tools:code_generator_util",
        "//build_tools:serialized_string_array_builder",
    ],
)

mozc_cc_library(
    name = "correction_rewriter",
    srcs = ["correction_rewriter.cc"],
    hdrs = ["correction_rewriter.h"],
    deps = [
        ":rewriter_interface",
        "//base:japanese_util",
        "//base:util",
        "//base/container:serialized_string_array",
        "//converter:attribute",
        "//converter:segments",
        "//data_manager",
        "//engine:modules",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_test(
    name = "correction_rewriter_test",
    size = "small",
    srcs = ["correction_rewriter_test.cc"],
    deps = [
        ":correction_rewriter",
        ":rewriter_interface",
        "//base/container:serialized_string_array",
        "//config:config_handler",
        "//converter:attribute",
        "//converter:segments",
        "//data_manager/testing:mock_data_manager",
        "//engine:modules",
        "//engine:supplemental_model_mock",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "//testing",
        "//testing:gunit_main",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:span",
    ],
)

mozc_cc_library(
    name = "a11y_description_rewriter",
    srcs = ["a11y_description_rewriter.cc"],
    hdrs = ["a11y_description_rewriter.h"],
    deps = [
        ":rewriter_interface",
        "//base:util",
        "//converter:segments",
        "//data_manager",
        "//data_manager:serialized_dictionary",
        "//protocol:commands_cc_proto",
        "//request:conversion_request",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/strings",
    ],
)

mozc_py_binary(
    name = "gen_a11y_description_rewriter_data",
    srcs = ["gen_a11y_description_rewriter_data.py"],
    visibility = ["//data_manager:__subpackages__"],
    deps = [
        "//build_tools:code_generator_util",
        "//build_tools:serialized_string_array_builder",
    ],
)

mozc_cc_test(
    name = "a11y_description_rewriter_test",
    size = "small",
    srcs = ["a11y_description_rewriter_test.cc"],
    deps = [
        ":a11y_description_rewriter",
        ":rewriter_interface",
        "//converter:segments",
        "//data_manager/testing:mock_data_manager",
        "//protocol:commands_cc_proto",
        "//request:conversion_request",
        "//testing:gunit_main",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_library(
    name = "rewriter",
    srcs = [
        "rewriter.cc",
    ],
    hdrs = ["rewriter.h"],
    visibility = [
        "//converter:__pkg__",
        "//engine:__pkg__",
    ],
    deps = [
        ":a11y_description_rewriter",
        ":calculator_rewriter",
        ":collocation_rewriter",
        ":command_rewriter",
        ":correction_rewriter",
        ":date_rewriter",
        ":dice_rewriter",
        ":emoji_rewriter",
        ":emoticon_rewriter",
        ":english_variants_rewriter",
        ":environmental_filter_rewriter",
        ":focus_candidate_rewriter",
        ":fortune_rewriter",
        ":ivs_variants_rewriter",
        ":language_aware_rewriter",
        ":merger_rewriter",
        ":number_rewriter",
        ":remove_redundant_candidate_rewriter",
        ":single_kanji_rewriter",
        ":small_letter_rewriter",
        ":symbol_rewriter",
        ":t13n_promotion_rewriter",
        ":transliteration_rewriter",
        ":unicode_rewriter",
        ":user_boundary_history_rewriter",
        ":user_dictionary_rewriter",
        ":user_segment_history_rewriter",
        ":variants_rewriter",
        ":version_rewriter",
        ":zipcode_rewriter",
        "//converter:converter_interface",
        "//data_manager",
        "//dictionary:dictionary_interface",
        "//dictionary:pos_group",
        "//dictionary:pos_matcher",
        "//dictionary:single_kanji_dictionary",
        "//engine:modules",
        "@com_google_absl//absl/flags:flag",
    ] + mozc_select_enable_usage_rewriter([
        ":usage_rewriter",
    ]),
    alwayslink = 1,
)

mozc_cc_test(
    name = "rewriter_test",
    size = "small",
    timeout = "moderate",
    srcs = ["rewriter_test.cc"],
    deps = [
        "rewriter",
        ":rewriter_interface",
        "//converter:attribute",
        "//converter:segments",
        "//data_manager/testing:mock_data_manager",
        "//engine:modules",
        "//request:conversion_request",
        "//testing:gunit_main",
        "//testing:mozctest",
        "@com_google_absl//absl/log:check",
    ],
)

mozc_cc_library(
    name = "collocation_util",
    srcs = ["collocation_util.cc"],
    hdrs = ["collocation_util.h"],
    deps = [
        "//base:util",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_test(
    name = "collocation_util_test",
    size = "small",
    srcs = ["collocation_util_test.cc"],
    deps = [
        ":collocation_util",
        "//testing:gunit_main",
    ],
)

mozc_cc_library(
    name = "gen_existence_data",
    srcs = ["gen_existence_data.cc"],
    hdrs = ["gen_existence_data.h"],
    deps = [
        "//base:codegen_bytearray_stream",
        "//storage:existence_filter",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:span",
    ],
)

mozc_cc_binary(
    name = "gen_collocation_data_main",
    srcs = ["gen_collocation_data_main.cc"],
    visibility = [
        "//:__subpackages__",
        "//data_manager:__subpackages__",
    ],
    deps = [
        ":gen_existence_data",
        "//base:file_stream",
        "//base:init_mozc_buildtool",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/log",
    ],
)

mozc_cc_binary(
    name = "gen_collocation_suppression_data_main",
    srcs = ["gen_collocation_suppression_data_main.cc"],
    visibility = [
        "//:__subpackages__",
        "//data_manager:__subpackages__",
    ],
    deps = [
        ":gen_existence_data",
        "//base:file_stream",
        "//base:init_mozc_buildtool",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_library(
    name = "number_compound_util",
    srcs = [
        "number_compound_util.cc",
    ],
    hdrs = ["number_compound_util.h"],
    deps = [
        "//base:util",
        "//base/container:serialized_string_array",
        "//converter:segments",
        "//dictionary:pos_matcher",
        "@com_google_absl//absl/base:no_destructor",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_library(
    name = "merger_rewriter",
    hdrs = ["merger_rewriter.h"],
    deps = [
        ":rewriter_interface",
        "//converter:segments",
        "//protocol:commands_cc_proto",
        "//protocol:config_cc_proto",
        "//request:conversion_request",
        "@com_google_absl//absl/log:check",
    ],
)

mozc_cc_test(
    name = "number_compound_util_test",
    srcs = ["number_compound_util_test.cc"],
    deps = [
        ":number_compound_util",
        "//base/container:serialized_string_array",
        "//converter:segments",
        "//data_manager/testing:mock_data_manager",
        "//dictionary:pos_matcher",
        "//testing:gunit_main",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_library(
    name = "rewriter_util",
    srcs = ["rewriter_util.cc"],
    hdrs = ["rewriter_util.h"],
    deps = [
        "//converter:attribute",
        "//converter:segments",
    ],
)

mozc_cc_test(
    name = "rewriter_util_test",
    srcs = ["rewriter_util_test.cc"],
    deps = [
        ":rewriter_util",
        "//converter:attribute",
        "//converter:segments",
        "//testing:gunit_main",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
    ],
)

mozc_cc_library(
    name = "ivs_variants_rewriter",
    srcs = ["ivs_variants_rewriter.cc"],
    hdrs = ["ivs_variants_rewriter.h"],
    deps = [
        ":rewriter_interface",
        "//converter:segments",
        "//request:conversion_request",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/strings",
    ],
)

mozc_cc_test(
    name = "ivs_variants_rewriter_test",
    srcs = ["ivs_variants_rewriter_test.cc"],
    deps = [
        ":ivs_variants_rewriter",
        "//converter:segments",
        "//request:conversion_request",
        "//testing:gunit_main",
    ],
)
