pub struct NewlineText { /* private fields */ }Expand description
A text model that splits on newlines instead of sentence punctuation
Implementations§
Source§impl NewlineText
impl NewlineText
Sourcepub fn new(
input_text: &str,
state_size: usize,
retain_original: bool,
well_formed: bool,
reject_reg: Option<&str>,
) -> Result<Self>
pub fn new( input_text: &str, state_size: usize, retain_original: bool, well_formed: bool, reject_reg: Option<&str>, ) -> Result<Self>
Create a new NewlineText model
Sourcepub fn sentence_split(&self, text: &str) -> Vec<String>
pub fn sentence_split(&self, text: &str) -> Vec<String>
Split text on newlines
Sourcepub fn make_sentence(
&self,
init_state: Option<&[String]>,
tries: Option<usize>,
max_overlap_ratio: Option<f64>,
max_overlap_total: Option<usize>,
test_output: Option<bool>,
max_words: Option<usize>,
min_words: Option<usize>,
) -> Option<String>
pub fn make_sentence( &self, init_state: Option<&[String]>, tries: Option<usize>, max_overlap_ratio: Option<f64>, max_overlap_total: Option<usize>, test_output: Option<bool>, max_words: Option<usize>, min_words: Option<usize>, ) -> Option<String>
Generate a sentence
Sourcepub fn make_short_sentence(
&self,
max_chars: usize,
min_chars: Option<usize>,
init_state: Option<&[String]>,
tries: Option<usize>,
max_overlap_ratio: Option<f64>,
max_overlap_total: Option<usize>,
test_output: Option<bool>,
max_words: Option<usize>,
min_words: Option<usize>,
) -> Option<String>
pub fn make_short_sentence( &self, max_chars: usize, min_chars: Option<usize>, init_state: Option<&[String]>, tries: Option<usize>, max_overlap_ratio: Option<f64>, max_overlap_total: Option<usize>, test_output: Option<bool>, max_words: Option<usize>, min_words: Option<usize>, ) -> Option<String>
Generate a short sentence
Trait Implementations§
Source§impl Clone for NewlineText
impl Clone for NewlineText
Source§fn clone(&self) -> NewlineText
fn clone(&self) -> NewlineText
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NewlineText
impl RefUnwindSafe for NewlineText
impl Send for NewlineText
impl Sync for NewlineText
impl Unpin for NewlineText
impl UnsafeUnpin for NewlineText
impl UnwindSafe for NewlineText
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