SentenceSegmenter constructor

SentenceSegmenter(
  1. DataProvider provider,
  2. Locale locale
)

Construct an `SentenceSegmenter`.

Throws DataError on failure.

Implementation

factory SentenceSegmenter(DataProvider provider, Locale locale) {
  final result = _icu4x_SentenceSegmenter_create_with_content_locale_mv1(provider._ffi, locale._ffi);
  if (!result.isOk) {
    throw DataError.values[result.union.err];
  }
  return SentenceSegmenter._fromFfi(result.union.ok, []);
}