Skip to content

Commit

Permalink
Add FFI for icu::segmenter::WordType::is_word_like (#4756)
Browse files Browse the repository at this point in the history
  • Loading branch information
kartva authored Mar 29, 2024
1 parent 8b13784 commit f693067
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions ffi/capi/bindings/c/ICU4XSegmenterWordType.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ffi/capi/bindings/cpp/ICU4XSegmenterWordType.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions ffi/capi/bindings/dart/SegmenterWordType.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions ffi/capi/src/segmenter_word.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ pub mod ffi {
#[diplomat::rust_link(icu::segmenter::WordBreakIteratorLatin1, Typedef, hidden)]
pub struct ICU4XWordBreakIteratorLatin1<'a>(WordBreakIteratorLatin1<'a, 'a>);

impl ICU4XSegmenterWordType {
#[diplomat::rust_link(icu::segmenter::WordType::is_word_like, FnInEnum)]
pub fn is_word_like(self) -> bool {
WordType::from(self).is_word_like()
}
}

impl ICU4XWordSegmenter {
/// Construct an [`ICU4XWordSegmenter`] with automatically selecting the best available LSTM
/// or dictionary payload data.
Expand Down
1 change: 0 additions & 1 deletion ffi/capi/tests/missing_apis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -583,4 +583,3 @@ icu::properties::names::PropertyEnumToValueNameLinearTiny4MapperBorrowed::get#Fn
icu::properties::names::PropertyEnumToValueNameSparseMapper#Struct
icu::properties::names::PropertyEnumToValueNameSparseMapperBorrowed#Struct
icu::properties::names::PropertyEnumToValueNameSparseMapperBorrowed::get#FnInStruct
icu::segmenter::WordType::is_word_like#FnInEnum

0 comments on commit f693067

Please sign in to comment.