[][src]Struct naromat::entities::sentence::Sentence

pub struct Sentence { /* fields omitted */ }

Structure of novel sentence.

Sentences are defined below:

  • Starts from previous sentence or breakline
  • End with sentence-terminators ('.', '。', '」'))
    • '. '
    • '。'
    • '」'
    • '!'
    • '?'
    • '!?'

Methods

impl Sentence[src]

Implementation for novel sentence structure

pub fn new(sentence: &str) -> Self[src]

Constructor

Example

use naromat::entities::sentence::Sentence;
 
Sentence::new("我が輩は猫である。");

pub fn print(self)[src]

Print formatted sentence

Example

use naromat::entities::sentence::Sentence;
 
let sentence = Sentence::new("我が輩は猫である。");
sentence.print()

pub fn get(self) -> String[src]

Get string of formatted sentence

Example

use naromat::entities::sentence::Sentence;
let sentence = Sentence::new("我が[輩:.]は[猫:ねこ]である");
assert_eq!(sentence.get(), "我が|輩《・》は|猫《ねこ》である");

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.