#counter #unicode #supporting #alphabetic

unicount-lib

Alphabetic counter supporting unicode

1 unstable release

0.1.0 Oct 26, 2024

#5 in #alphabetic

Download history 102/week @ 2024-10-21 32/week @ 2024-10-28

134 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.6–2.2MB
~39K SLoC