pub(super) struct LstmSegmenter<'data> {
dic: ZeroMapBorrowed<'data, PotentialUtf8, u16>,
embedding: MatrixZero<'data, 2>,
fw_w: MatrixZero<'data, 3>,
fw_u: MatrixZero<'data, 3>,
fw_b: MatrixZero<'data, 2>,
bw_w: MatrixZero<'data, 3>,
bw_u: MatrixZero<'data, 3>,
bw_b: MatrixZero<'data, 2>,
timew_fw: MatrixZero<'data, 2>,
timew_bw: MatrixZero<'data, 2>,
time_b: MatrixZero<'data, 1>,
grapheme: Option<GraphemeClusterSegmenterBorrowed<'data>>,
}Fields§
§dic: ZeroMapBorrowed<'data, PotentialUtf8, u16>§embedding: MatrixZero<'data, 2>§fw_w: MatrixZero<'data, 3>§fw_u: MatrixZero<'data, 3>§fw_b: MatrixZero<'data, 2>§bw_w: MatrixZero<'data, 3>§bw_u: MatrixZero<'data, 3>§bw_b: MatrixZero<'data, 2>§timew_fw: MatrixZero<'data, 2>§timew_bw: MatrixZero<'data, 2>§time_b: MatrixZero<'data, 1>§grapheme: Option<GraphemeClusterSegmenterBorrowed<'data>>Implementations§
Source§impl<'data> LstmSegmenter<'data>
impl<'data> LstmSegmenter<'data>
Sourcepub(super) fn new(
lstm: &'data LstmData<'data>,
grapheme: GraphemeClusterSegmenterBorrowed<'data>,
) -> Self
pub(super) fn new( lstm: &'data LstmData<'data>, grapheme: GraphemeClusterSegmenterBorrowed<'data>, ) -> Self
Returns Err if grapheme data is required but not present
Sourcepub(super) fn segment_str<'a>(
&'a self,
input: &'a str,
) -> LstmSegmenterIterator<'a, 'data> ⓘ
pub(super) fn segment_str<'a>( &'a self, input: &'a str, ) -> LstmSegmenterIterator<'a, 'data> ⓘ
Create an LSTM based break iterator for an str (a UTF-8 string).
Sourcepub(super) fn segment_utf16<'a>(
&'a self,
input: &[u16],
) -> LstmSegmenterIteratorUtf16<'a, 'data> ⓘ
pub(super) fn segment_utf16<'a>( &'a self, input: &[u16], ) -> LstmSegmenterIteratorUtf16<'a, 'data> ⓘ
Create an LSTM based break iterator for a UTF-16 string.
Auto Trait Implementations§
impl<'data> Freeze for LstmSegmenter<'data>
impl<'data> RefUnwindSafe for LstmSegmenter<'data>
impl<'data> Send for LstmSegmenter<'data>
impl<'data> Sync for LstmSegmenter<'data>
impl<'data> Unpin for LstmSegmenter<'data>
impl<'data> UnsafeUnpin for LstmSegmenter<'data>
impl<'data> UnwindSafe for LstmSegmenter<'data>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more