Expand description
oink
is a library & command-line tool that allows you to translate from English to Pig Latin.
§How to use as a library
use oink::{word_to_pig_latin, sentence_to_pig_latin};
// Convert a single word to pig latin & print it.
match word_to_pig_latin("Word") {
Some(word) => {println!("{}", word)}
None => {println!("Word")}
}
// Convert a sentence/paragraph(s) to pig latin & print it.
match sentence_to_pig_latin("This is a sentence.") {
Some(sentence) => {println!("{}", sentence)}
None => {println!("This is a sentence.")}
}
§How to use as a command-line tool
Install using cargo
:
cargo install oink
Use command:
oink <STRING>
Functions§
- sentence_
to_ pig_ latin - Translates a sentence from English to Pig Latin.
- word_
to_ pig_ latin - Translates a single word from English to Pig Latin.