pub struct AntonymRegistry { /* private fields */ }Expand description
Registry of phrase-level antonym substitutions used for positive framings of negative statements.
Implementations§
Source§impl AntonymRegistry
impl AntonymRegistry
pub fn new() -> Self
Sourcepub fn register(&mut self, negative: &str, positive: &str)
pub fn register(&mut self, negative: &str, positive: &str)
Register that the negative phrase negative should be rendered
as the positive phrase positive when used via {phrase|negated}.
Matching is case-insensitive; the registered positive form keeps
its original casing.
Sourcepub fn lookup(&self, negative: &str) -> Option<&str>
pub fn lookup(&self, negative: &str) -> Option<&str>
Look up a positive antonym for the given phrase. Returns None
when no antonym has been registered.
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
Trait Implementations§
Source§impl Clone for AntonymRegistry
impl Clone for AntonymRegistry
Source§fn clone(&self) -> AntonymRegistry
fn clone(&self) -> AntonymRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AntonymRegistry
impl Debug for AntonymRegistry
Source§impl Default for AntonymRegistry
impl Default for AntonymRegistry
Source§fn default() -> AntonymRegistry
fn default() -> AntonymRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AntonymRegistry
impl RefUnwindSafe for AntonymRegistry
impl Send for AntonymRegistry
impl Sync for AntonymRegistry
impl Unpin for AntonymRegistry
impl UnsafeUnpin for AntonymRegistry
impl UnwindSafe for AntonymRegistry
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