Struct igpay_atinlay::IgpayAtinlay [−][src]
Transformer from text to Pig Latin.
Implementations
impl IgpayAtinlay
[src]
pub fn new(vowel_suffix: &str, split_hyphens: bool) -> Self
[src]
Create a new Pig Latin translator.
vowel_suffix
is the string appended before “ay” after words beginning with a vowel:
this is usually “w” or “h”, but also might be “j”, “” or any of a number of other
things depending on the Pig Latin “dialect”.
Iff split_hyphens
is true
, treat hyphens as word boundaries.
pub fn word_to_pig_latin(&self, word: &str) -> String
[src]
Transform word
to Pig Latin. Word is
assumed to be in a Romance language:
see [IsRomanceVowel][IsRomanceVowel]::[is_romance_vowel][is_romance_vowel]
for the
definition of “vowel” used here. Leading non-alphabetic characters will be stripped,
trailing will be preserved.
Examples
let pig = IgpayAtinlay::new("h", false); assert_eq!(pig.word_to_pig_latin("Aye"), "Ayehay"); let pig = IgpayAtinlay::new("", false); assert_eq!(pig.word_to_pig_latin("Aye"), "Ayeay"); let pig = IgpayAtinlay::new("w", false); assert_eq!(pig.word_to_pig_latin("argle-bargle"), "argle-bargleway"); let pig = IgpayAtinlay::new("w", false); assert_eq!(pig.word_to_pig_latin("ding-dong"), "ing-dongday"); assert_eq!(pig.word_to_pig_latin("*ding-dong*"), "ing-dong*day");
pub fn text_to_pig_latin(&self, text: &str) -> String
[src]
Transform text
to Pig Latin
Examples
let pig = IgpayAtinlay::new("h", false); let pigtext=pig.text_to_pig_latin("Can't touch this! Awoo-away!"); assert_eq!(pigtext, "An'tcay ouchtay histay! Awoo-awayhay!");
Trait Implementations
impl Clone for IgpayAtinlay
[src]
fn clone(&self) -> IgpayAtinlay
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for IgpayAtinlay
[src]
Auto Trait Implementations
impl RefUnwindSafe for IgpayAtinlay
impl Send for IgpayAtinlay
impl Sync for IgpayAtinlay
impl Unpin for IgpayAtinlay
impl UnwindSafe for IgpayAtinlay
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,