Unicode Collation Algorithm and DUCET sort-key toolkit for MoonBit
Dependencies

Status: v0.2.0. Conformance claims are made only for test profiles recorded in docs/conformance.md.
///|
test {
let collator = default_collator()
inspect(collator.compare("resume", "résumé").to_string(), content="Less")
}moon add CaptainK-65/moon-collate@0.2.0///|
test {
let collator = default_collator().with_numeric(true)
assert_eq(collator.sort(["file10", "file2", "file1"]), [
"file1", "file2", "file10",
])
}moon run cmd/main -- compare resume résumé
moon run cmd/main -- sort --numeric file10 file2 file1
moon run cmd/main -- explain cafémoon update
moon check --target all
moon test --target all
moon run --target native cmd/conformance
moon run --target native cmd/conformance -- --shifted
moon run --target native cmd/conformance -- --full
moon run --target native cmd/conformance -- --full --shifted
moon info
moon fmtfn CollationElement::new(primary~ : Int, secondary~ : Int, tertiary~ : Int, quaternary? : Int, variable? : Bool) -> CollationElementpub(all) struct Collator {
strength : Strength
alternate : AlternateHandling
case_first : CaseFirst
backwards_secondary : Bool
numeric : Bool
}fn Collator::new(strength? : Strength, alternate? : AlternateHandling, case_first? : CaseFirst, backwards_secondary? : Bool, numeric? : Bool) -> Collatorpub(all) struct ComparisonDifference {
level : DifferenceLevel
index : Int
left_weight : Int
right_weight : Int
} derive(Eq, ToJson, Debug)let UCA_VERSION : StringInstall
Download zipUnicode Collation Algorithm and DUCET sort-key toolkit for MoonBit
Dependencies