#counter #supporting #unicode #alphabetic

unicount-lib

Alphabetic counter supporting unicode

2 releases

0.1.1 Dec 5, 2024
0.1.0 Oct 26, 2024

#4 in #alphabetic

Download history 78/week @ 2024-10-20 56/week @ 2024-10-27 3/week @ 2024-11-17 1/week @ 2024-11-24 157/week @ 2024-12-01 26/week @ 2024-12-08

187 downloads per month
Used in unicount

MIT license

4KB
56 lines

Examples

assert_eq!(
    unicount_lib::Kind::EnglishLower.counter(0).take(30).collect::<Vec<_>>(),
    vec![
        "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q",
        "r", "s", "t", "u", "v", "w", "x", "y", "z", "aa", "ab", "ac", "ad"
    ],
);

assert_eq!(
    unicount_lib::Kind::EnglishUpper.counter(0).take(30).collect::<Vec<_>>(),
    vec![
      "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q",
      "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "AA", "AB", "AC", "AD"
    ],
);

assert_eq!(
    unicount_lib::Counter::new("abc", 0).take(30).collect::<Vec<_>>(),
    vec![
        "a", "b", "c", "aa", "ab", "ac", "ba", "bb", "bc", "ca", "cb", "cc", "aaa", "aab",
        "aac", "aba", "abb", "abc", "aca", "acb", "acc", "baa", "bab", "bac", "bba", "bbb",
        "bbc", "bca", "bcb", "bcc"
    ],
);

Dependencies

~1.5–2.1MB
~37K SLoC