Skip to content

A simple Rust library to convert strings into Pig Latin. Lightweight and easy to use, with no support for punctuation marks.

License

Notifications You must be signed in to change notification settings

haritonov2/rust_pig_latin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Pig Latin Converter

This is a simple Rust library for converting strings to Pig Latin. The first consonant of each word is moved to the end of the word with "ay" added (e.g., "car" becomes "ar-cay"). Words that start with a vowel have "hay" added to the end (e.g., "apple" becomes "apple-hay").

Usage

To use this library in your Rust project, add the following to your Cargo.toml dependencies section:

[dependencies]
rust_pig_latin = { git = "https://github.com/your_username/rust_pig_latin" }

Then, in your Rust code:

use rust_pig_latin::pig_latin;

fn main() {
    let origin = "it is my new car";
    let pig_latin = pig_latin::translate(origin);

    println!("Origin: {}", origin);
    println!("Pig Latin: {}", pig_latin);
}

Limitations

  • This library currently does not support punctuation marks such as dots, commas, and other symbols.
  • Make sure to handle special cases of punctuation outside the library.

Running Examples

You can find example code in the examples/ folder. To run an example, use:

cargo run --example basic_usage

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A simple Rust library to convert strings into Pig Latin. Lightweight and easy to use, with no support for punctuation marks.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages