goodname

Crates.iogoodname
lib.rsgoodname
version0.2.2
sourcesrc
created_at2022-08-11 11:21:48.19012
updated_at2022-08-11 15:29:49.458938
descriptionGoodname: Tool to assist you with cool naming of your methods and software
homepagehttps://github.com/kampersanda/goodname
repositoryhttps://github.com/kampersanda/goodname
max_upload_size
id643260
size23,537
Shunsuke Kanda (kampersanda)

documentation

README

Goodname

Goodname is a tool to assist you with cool naming of your methods and software. Given a brief description of your method or software, this tool enumerates name candidates forming subsequences of the description (i.e., acronym).

For example, given description "Character-wise Double-array Dictionary" of your software, this tool will suggest some name candidates such as "crawdad" and "cheddar".

Examples

use goodname::{Enumerator, Lexicon, Match};

let words = &["aa", "abaab", "abb", "bab", "bb", "bbb", "cbab", "ccbab"];
let lex = Lexicon::new(words).unwrap();
let text = "abAaB";

let enumerator = Enumerator::new(&lex, text).unwrap().prefix_len(2).unwrap();
let matched = enumerator.all_subsequences().unwrap();

assert_eq!(matched.len(), 4);
assert_eq!(
    enumerator.format_match(&matched[0]),
    ("abaab".to_string(), "ABAAB".to_string())
);
assert_eq!(
    enumerator.format_match(&matched[1]),
    ("bab".to_string(), "aBAaB".to_string())
);
assert_eq!(
    enumerator.format_match(&matched[2]),
    ("Cbab".to_string(), "aBAaB".to_string())
);
assert_eq!(
    enumerator.format_match(&matched[3]),
    ("CCbab".to_string(), "aBAaB".to_string())
);
Commit count: 69

cargo fmt