class ICU4XDataProvider; class ICU4XLineSegmenter; #include"ICU4XError.hpp" struct ICU4XLineBreakOptionsV1; class ICU4XLineBreakIteratorUtf8; class ICU4XLineBreakIteratorUtf16; class ICU4XLineBreakIteratorLatin1;
/** * A destruction policy for using ICU4XLineSegmenter with std::unique_ptr.
*/ struct ICU4XLineSegmenterDeleter { voidoperator()(capi::ICU4XLineSegmenter* l) const noexcept {
capi::ICU4XLineSegmenter_destroy(l);
}
};
/** * Construct a [`ICU4XLineSegmenter`] with default options. It automatically loads the best * available payload data for Burmese, Khmer, Lao, and Thai. * * See the [Rust documentation for `new_auto`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_auto) for more information.
*/ static diplomat::result<ICU4XLineSegmenter, ICU4XError> create_auto(const ICU4XDataProvider& provider);
/** * Construct a [`ICU4XLineSegmenter`] with default options and LSTM payload data for * Burmese, Khmer, Lao, and Thai. * * See the [Rust documentation for `new_lstm`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_lstm) for more information.
*/ static diplomat::result<ICU4XLineSegmenter, ICU4XError> create_lstm(const ICU4XDataProvider& provider);
/** * Construct a [`ICU4XLineSegmenter`] with default options and dictionary payload data for * Burmese, Khmer, Lao, and Thai.. * * See the [Rust documentation for `new_dictionary`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_dictionary) for more information.
*/ static diplomat::result<ICU4XLineSegmenter, ICU4XError> create_dictionary(const ICU4XDataProvider& provider);
/** * Construct a [`ICU4XLineSegmenter`] with custom options. It automatically loads the best * available payload data for Burmese, Khmer, Lao, and Thai. * * See the [Rust documentation for `new_auto_with_options`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_auto_with_options) for more information.
*/ static diplomat::result<ICU4XLineSegmenter, ICU4XError> create_auto_with_options_v1(const ICU4XDataProvider& provider, ICU4XLineBreakOptionsV1 options);
/** * Construct a [`ICU4XLineSegmenter`] with custom options and LSTM payload data for * Burmese, Khmer, Lao, and Thai. * * See the [Rust documentation for `new_lstm_with_options`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_lstm_with_options) for more information.
*/ static diplomat::result<ICU4XLineSegmenter, ICU4XError> create_lstm_with_options_v1(const ICU4XDataProvider& provider, ICU4XLineBreakOptionsV1 options);
/** * Construct a [`ICU4XLineSegmenter`] with custom options and dictionary payload data for * Burmese, Khmer, Lao, and Thai. * * See the [Rust documentation for `new_dictionary_with_options`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.new_dictionary_with_options)for more information.
*/ static diplomat::result<ICU4XLineSegmenter, ICU4XError> create_dictionary_with_options_v1(const ICU4XDataProvider& provider, ICU4XLineBreakOptionsV1 options);
/** * Segments a string. * * Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according * to the WHATWG Encoding Standard. * * See the [Rust documentation for `segment_utf8`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.segment_utf8) for more information. * * Lifetimes: `this`, `input` must live at least as long as the output.
*/
ICU4XLineBreakIteratorUtf8 segment_utf8(const std::string_view input) const;
/** * Segments a string. * * Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according * to the WHATWG Encoding Standard. * * See the [Rust documentation for `segment_utf16`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.segment_utf16) for more information. * * Lifetimes: `this`, `input` must live at least as long as the output.
*/
ICU4XLineBreakIteratorUtf16 segment_utf16(const std::u16string_view input) const;
/** * Segments a Latin-1 string. * * See the [Rust documentation for `segment_latin1`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.segment_latin1) for more information. * * Lifetimes: `this`, `input` must live at least as long as the output.
*/
ICU4XLineBreakIteratorLatin1 segment_latin1(const diplomat::span<const uint8_t> input) const; inlineconst capi::ICU4XLineSegmenter* AsFFI() const { return this->inner.get(); } inline capi::ICU4XLineSegmenter* AsFFIMut() { return this->inner.get(); } inlineexplicit ICU4XLineSegmenter(capi::ICU4XLineSegmenter* i) : inner(i) {}
ICU4XLineSegmenter() = default;
ICU4XLineSegmenter(ICU4XLineSegmenter&&) noexcept = default;
ICU4XLineSegmenter& operator=(ICU4XLineSegmenter&& other) noexcept = default; private:
std::unique_ptr<capi::ICU4XLineSegmenter, ICU4XLineSegmenterDeleter> inner;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.