Crates.io | goodname |
lib.rs | goodname |
version | 0.2.2 |
source | src |
created_at | 2022-08-11 11:21:48.19012 |
updated_at | 2022-08-11 15:29:49.458938 |
description | Goodname: Tool to assist you with cool naming of your methods and software |
homepage | https://github.com/kampersanda/goodname |
repository | https://github.com/kampersanda/goodname |
max_upload_size | |
id | 643260 |
size | 23,537 |
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".
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())
);