1#ifndef ICU4XLineSegmenter_HPP
2#define ICU4XLineSegmenter_HPP
12#include "ICU4XLineSegmenter.h"
25struct ICU4XLineSegmenterDeleter {
26 void operator()(capi::ICU4XLineSegmenter* l)
const noexcept {
27 capi::ICU4XLineSegmenter_destroy(l);
119 inline const capi::ICU4XLineSegmenter* AsFFI()
const {
return this->inner.get(); }
120 inline capi::ICU4XLineSegmenter* AsFFIMut() {
return this->inner.get(); }
129#include "ICU4XDataProvider.hpp"
136 auto diplomat_result_raw_out_value = capi::ICU4XLineSegmenter_create_auto(provider.AsFFI());
138 if (diplomat_result_raw_out_value.is_ok) {
143 return diplomat_result_out_value;
146 auto diplomat_result_raw_out_value = capi::ICU4XLineSegmenter_create_lstm(provider.AsFFI());
148 if (diplomat_result_raw_out_value.is_ok) {
153 return diplomat_result_out_value;
156 auto diplomat_result_raw_out_value = capi::ICU4XLineSegmenter_create_dictionary(provider.AsFFI());
158 if (diplomat_result_raw_out_value.is_ok) {
163 return diplomat_result_out_value;
167 auto diplomat_result_raw_out_value = capi::ICU4XLineSegmenter_create_auto_with_options_v1(provider.AsFFI(), capi::ICU4XLineBreakOptionsV1{ .strictness = static_cast<capi::ICU4XLineBreakStrictness>(diplomat_wrapped_struct_options.strictness), .word_option = static_cast<capi::ICU4XLineBreakWordOption>(diplomat_wrapped_struct_options.word_option), .ja_zh = diplomat_wrapped_struct_options.ja_zh });
169 if (diplomat_result_raw_out_value.is_ok) {
174 return diplomat_result_out_value;
178 auto diplomat_result_raw_out_value = capi::ICU4XLineSegmenter_create_lstm_with_options_v1(provider.AsFFI(), capi::ICU4XLineBreakOptionsV1{ .strictness = static_cast<capi::ICU4XLineBreakStrictness>(diplomat_wrapped_struct_options.strictness), .word_option = static_cast<capi::ICU4XLineBreakWordOption>(diplomat_wrapped_struct_options.word_option), .ja_zh = diplomat_wrapped_struct_options.ja_zh });
180 if (diplomat_result_raw_out_value.is_ok) {
185 return diplomat_result_out_value;
189 auto diplomat_result_raw_out_value = capi::ICU4XLineSegmenter_create_dictionary_with_options_v1(provider.AsFFI(), capi::ICU4XLineBreakOptionsV1{ .strictness = static_cast<capi::ICU4XLineBreakStrictness>(diplomat_wrapped_struct_options.strictness), .word_option = static_cast<capi::ICU4XLineBreakWordOption>(diplomat_wrapped_struct_options.word_option), .ja_zh = diplomat_wrapped_struct_options.ja_zh });
191 if (diplomat_result_raw_out_value.is_ok) {
196 return diplomat_result_out_value;
ICU4XError
Definition ICU4XError.hpp:23
Definition ICU4XDataProvider.hpp:32
Definition ICU4XLineBreakIteratorLatin1.hpp:29
Definition ICU4XLineBreakIteratorUtf16.hpp:29
Definition ICU4XLineBreakIteratorUtf8.hpp:29
Definition ICU4XLineSegmenter.hpp:36
static diplomat::result< ICU4XLineSegmenter, ICU4XError > create_auto_with_options_v1(const ICU4XDataProvider &provider, ICU4XLineBreakOptionsV1 options)
Definition ICU4XLineSegmenter.hpp:165
static diplomat::result< ICU4XLineSegmenter, ICU4XError > create_dictionary(const ICU4XDataProvider &provider)
Definition ICU4XLineSegmenter.hpp:155
ICU4XLineBreakIteratorLatin1 segment_latin1(const diplomat::span< const uint8_t > input) const
Definition ICU4XLineSegmenter.hpp:204
ICU4XLineSegmenter(capi::ICU4XLineSegmenter *i)
Definition ICU4XLineSegmenter.hpp:121
ICU4XLineBreakIteratorUtf16 segment_utf16(const std::u16string_view input) const
Definition ICU4XLineSegmenter.hpp:201
static diplomat::result< ICU4XLineSegmenter, ICU4XError > create_lstm(const ICU4XDataProvider &provider)
Definition ICU4XLineSegmenter.hpp:145
ICU4XLineBreakIteratorUtf8 segment_utf8(const std::string_view input) const
Definition ICU4XLineSegmenter.hpp:198
ICU4XLineSegmenter(ICU4XLineSegmenter &&) noexcept=default
static diplomat::result< ICU4XLineSegmenter, ICU4XError > create_auto(const ICU4XDataProvider &provider)
Definition ICU4XLineSegmenter.hpp:135
ICU4XLineSegmenter()=default
static diplomat::result< ICU4XLineSegmenter, ICU4XError > create_dictionary_with_options_v1(const ICU4XDataProvider &provider, ICU4XLineBreakOptionsV1 options)
Definition ICU4XLineSegmenter.hpp:187
static diplomat::result< ICU4XLineSegmenter, ICU4XError > create_lstm_with_options_v1(const ICU4XDataProvider &provider, ICU4XLineBreakOptionsV1 options)
Definition ICU4XLineSegmenter.hpp:176
Definition diplomat_runtime.hpp:84
Definition diplomat_runtime.hpp:144
constexpr T * data() const noexcept
Definition diplomat_runtime.hpp:152
constexpr size_t size() const noexcept
Definition diplomat_runtime.hpp:155
Definition ICU4XLineBreakOptionsV1.hpp:21
Definition diplomat_runtime.hpp:69
Definition diplomat_runtime.hpp:55