use std::env;
use inflections::Inflect;
fn main() {
let args: Vec<String> = env::args().collect();
let inflected = transpose(inflect(args[1..].to_vec()));
for inflected_words in inflected {
println!("{}", inflected_words.join(" "));
}
}
pub fn inflect(words: Vec<String>) -> Vec<Vec<String>>{
let mut out = Vec::with_capacity(words.len());
for w in words.iter() {
let mut word_inflections: Vec<String> = Vec::with_capacity(10);
word_inflections.push(w.to_camel_case().to_lowercase());
word_inflections.push(w.to_camel_case().to_uppercase());
word_inflections.push(w.to_camel_case());
word_inflections.push(w.to_pascal_case());
word_inflections.push(w.to_kebab_case());
word_inflections.push(w.to_train_case());
word_inflections.push(w.to_snake_case());
word_inflections.push(w.to_constant_case());
out.push(word_inflections);
}
out
}
pub fn transpose(xs: Vec<Vec<String>>) -> Vec<Vec<String>> {
let mut out = vec![vec!["".to_owned(); xs.len()]; xs[0].len()];
for i in 0..xs[0].len() {
for j in 0..xs.len() {
out[i][j] = xs[j][i].clone();
}
}
out
}