class ICU4XDataProvider; class ICU4XSentenceSegmenter; #include"ICU4XError.hpp" class ICU4XSentenceBreakIteratorUtf8; class ICU4XSentenceBreakIteratorUtf16; class ICU4XSentenceBreakIteratorLatin1;
/** * A destruction policy for using ICU4XSentenceSegmenter with std::unique_ptr.
*/ struct ICU4XSentenceSegmenterDeleter { voidoperator()(capi::ICU4XSentenceSegmenter* l) const noexcept {
capi::ICU4XSentenceSegmenter_destroy(l);
}
};
/** * An ICU4X sentence-break segmenter, capable of finding sentence breakpoints in strings. * * See the [Rust documentation for `SentenceSegmenter`](https://docs.rs/icu/latest/icu/segmenter/struct.SentenceSegmenter.html) for more information.
*/ class ICU4XSentenceSegmenter { public:
/** * 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.SentenceSegmenter.html#method.segment_utf8) for more information. * * Lifetimes: `this`, `input` must live at least as long as the output.
*/
ICU4XSentenceBreakIteratorUtf8 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.SentenceSegmenter.html#method.segment_utf16) for more information. * * Lifetimes: `this`, `input` must live at least as long as the output.
*/
ICU4XSentenceBreakIteratorUtf16 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.SentenceSegmenter.html#method.segment_latin1) for more information. * * Lifetimes: `this`, `input` must live at least as long as the output.
*/
ICU4XSentenceBreakIteratorLatin1 segment_latin1(const diplomat::span<const uint8_t> input) const; inlineconst capi::ICU4XSentenceSegmenter* AsFFI() const { return this->inner.get(); } inline capi::ICU4XSentenceSegmenter* AsFFIMut() { return this->inner.get(); } inlineexplicit ICU4XSentenceSegmenter(capi::ICU4XSentenceSegmenter* i) : inner(i) {}
ICU4XSentenceSegmenter() = default;
ICU4XSentenceSegmenter(ICU4XSentenceSegmenter&&) noexcept = default;
ICU4XSentenceSegmenter& operator=(ICU4XSentenceSegmenter&& other) noexcept = default; private:
std::unique_ptr<capi::ICU4XSentenceSegmenter, ICU4XSentenceSegmenterDeleter> 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.