diff --git a/README.md b/README.md index fd6e7a7..0cf62fd 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,21 @@ canonicalizing identifiers all break subtly when `"café"` (composed) and `"café"` (decomposed) are treated as different strings. This library makes them equal. +### Coming from Python + +If you know Python's `unicodedata`, the normalization entry points map directly: + +| Python | mojo-unicodedata | +| --------------------------------------- | ------------------------------ | +| `unicodedata.normalize("NFC", s)` | `normalize("NFC", s)` | +| `unicodedata.normalize("NFKD", s)` | `normalize("NFKD", s)` | +| `unicodedata.is_normalized("NFC", s)` | `is_normalized("NFC", s)` | +| `s.casefold()` | `casefold(s)` | + +These are module-level functions. If you normalize many strings, construct a +`Normalizer()` once and call `.normalize(form, s)` / `.casefold(s)` on it to +reuse the loaded tables. + ## What it handles - **All four normalization forms**: `normalize("NFC"|"NFD"|"NFKC"|"NFKD", s)`, @@ -155,9 +170,11 @@ described above. ## Part of a pure-Mojo library suite -Ten pure-Mojo libraries that mirror familiar Python stdlib and PyPI APIs, +Eleven pure-Mojo libraries that mirror familiar Python stdlib and PyPI APIs, filling gaps in the native Mojo ecosystem: +- [mojo-xml](https://github.com/conorbronsdon/mojo-xml) — general-purpose XML + parsing, an ElementTree-shaped DOM (Python's `xml.etree.ElementTree`) - [mojo-feed](https://github.com/conorbronsdon/mojo-feed) — RSS, Atom, and JSON Feed parsing (Python's `feedparser`) - [mojo-captions](https://github.com/conorbronsdon/mojo-captions) — SRT and