pub struct FixedFormatter {
length: usize,
keep_original: bool,
break_words: bool,
insert_fullwidth_space_at_line_start: bool,
break_with_sentence: bool,
jieba: Option<Jieba>,
typ: Option<ScriptType>,
}Fields§
§length: usize§keep_original: bool§break_words: boolWhether to break words (ASCII only) at the end of the line.
insert_fullwidth_space_at_line_start: boolWhether to insert a full-width space after a line break when a sentence starts with a full-width quotation mark.
break_with_sentence: boolIf a line break occurs in the middle of some symbols, bring the sentence to next line
jieba: Option<Jieba>Available on crate feature
jieba only.Jieba instance for Chinese word segmentation.
typ: Option<ScriptType>Implementations§
Source§impl FixedFormatter
impl FixedFormatter
pub fn new( length: usize, keep_original: bool, break_words: bool, insert_fullwidth_space_at_line_start: bool, break_with_sentence: bool, break_chinese_words: bool, jieba_dict: Option<String>, typ: Option<ScriptType>, ) -> Result<Self>
fn is_circus(&self) -> bool
Available on crate feature
circus only.fn is_scn(&self) -> bool
Available on crate feature
kirikiri only.pub fn format(&self, message: &str) -> String
Auto Trait Implementations§
impl Freeze for FixedFormatter
impl RefUnwindSafe for FixedFormatter
impl Send for FixedFormatter
impl Sync for FixedFormatter
impl Unpin for FixedFormatter
impl UnwindSafe for FixedFormatter
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more