Crates.io | uwurs |
lib.rs | uwurs |
version | 0.3.4 |
source | src |
created_at | 2024-11-14 13:25:53.373445 |
updated_at | 2024-11-15 01:23:24.210969 |
description | UwUify your strings with uwurs! |
homepage | https://keiran.cc/uwurs |
repository | https://github.com/KeiranScript/uwurs |
max_upload_size | |
id | 1447800 |
size | 29,961 |
This documentation corresponds to uwurs version 0.3.1
[dependencies]
uwurs = "0.3.1"
rand = "0.8.5"
Cargo.toml
or via cargo add uwurs
To start using uwurs, create a new instance of UwUifier:
use uwurs::UwUifier;
fn main() {
let uwuifier = UwUifier::new();
let input = "Hello, world!";
let uwuified = uwuifier.uwuify(input);
println!("{}", uwuified);
}
Transform a string into UwU style:
let input = "This is a test.";
let uwuified = uwuifier.uwuify(input);
println!("{}", uwuified);
Convert text to leet speak:
let input = "Leetify this text.";
let leet = uwuifier.leetify(input);
println!("{}", leet);
Reverse the characters in a string:
let input = "Reverse this.";
let reversed = uwuifier.reverse_text(input);
println!("{}", reversed);
Adjust the probability of adding stutters to words:
uwuifier.set_stutter_probability(0.2); // 20% chance
Adjust the probability of adding emojis:
uwuifier.set_emoji_probability(0.3); // 30% chance
Add custom emoticons to the UwUifier:
uwuifier.add_emoticon("(* ^ ω ^)");
Add custom interjections:
uwuifier.add_interjection("nya");
Define custom word mappings:
uwuifier.add_custom_mapping("hello", "hewwo");
Associate words with emojis:
uwuifier.add_emoji_mapping("happy", "😊");
pub struct UwUifier {
pub emoticons: Vec<&'static str>,
pub interjections: Vec<&'static str>,
pub stutter_probability: f64,
pub emoji_probability: f64,
pub custom_map: HashMap<String, String>,
pub emoji_map: HashMap<String, String>,
}
Create a new UwUifier instance with default settings
new() -> Self
Transform the input string into UwU style
uwuify(&self, input: &str) -> String
Set the probability for stuttering
set_stutter_probability(&mut self, probability: f64)
Set the probability for adding emojis
set_emoji_probability(&mut self, probability: f64)
Add a new emoticon to the list
add_emoticon(&mut self, emoticon: &'static str)
Add a new interjection
add_interjection(&mut self, interjection: &'static str)
Add a custom word mapping
add_custom_mapping(&mut self, from: &str, to: &str)
Associate a word with an emoji
add_emoji_mapping(&mut self, word: &str, emoji: &str)
Convert the input string to leet speak
leetify(&self, input: &str) -> String
Reverse the input string
reverse_text(&self, input: &str) -> String
Transform specific characters to UwU style
apply_character_transformations
Add a stutter to a word based on probability
apply_stutter
Convert characters to their leet equivalents
leetify
Reverse the input string
reverse_text
use uwurs::UwUifier;
fn main() {
let uwuifier = UwUifier::new();
let input = "I love programming!";
let uwuified = uwuifier.uwuify(input);
println!("{}", uwuified);
}
use uwurs::UwUifier;
fn main() {
let mut uwuifier = UwUifier::new();
uwuifier.add_custom_mapping("friend", "fwiend");
uwuifier.add_emoji_mapping("happy", "😊");
let input = "Hello, my friend! I am happy.";
let uwuified = uwuifier.uwuify(input);
println!("{}", uwuified);
}
use uwurs::UwUifier;
fn main() {
let uwuifier = UwUifier::new();
let leet = uwuifier.leetify("Leetify this text.");
println!("{}", leet);
let reversed = uwuifier.reverse_text("Reverse this.");
println!("{}", reversed);
}
Contributions are welcome! Please submit a pull request or open an issue on the GitHub Repository.
If you'd like to contribute to uwurs, please follow these steps: