name-variants 0.1.0

Multilingual name romanization lookup tables: Chinese, Japanese, Korean, Arabic, Vietnamese, Indian, Persian, Hebrew, Thai, Greek, Turkish, Russian, Indonesian/Malay
Documentation
  • Coverage
  • 100%
    5 out of 5 items documented3 out of 4 items with examples
  • Size
  • Source code size: 388.32 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.06 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 26s Average build duration of successful builds.
  • all releases: 26s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • SecurityRonin/name-variants
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • h4x0r

name-variants

Multilingual name romanization lookup tables for Rust — Chinese, Japanese, Korean, Arabic, Vietnamese, Indian, Persian, Hebrew, Thai, Greek, Turkish, Russian, Indonesian/Malay.

Maps romanization variants to their canonical native-script key so that Chen, Chan, and Tan all resolve to .

Usage

use name_variants::lookup_key;

assert_eq!(lookup_key("Chan"),      Some(""));
assert_eq!(lookup_key("chen"),      Some(""));   // case-insensitive
assert_eq!(lookup_key("park"),      Some(""));
assert_eq!(lookup_key("Muhammad"),  Some("محمد"));
assert_eq!(lookup_key("Smith"),     None);

// Multi-word: first matching token wins
assert_eq!(lookup_key("Chan Wai Ming"), Some(""));

Install

[dependencies]
name-variants = "0.1"

Design

  • Canonical key is always the native script form, , محمد
  • Zero runtime dependencies — all data in a compile-time perfect hash map (phf)
  • Case-insensitive — input is lowercased before lookup
  • None for unknowns — explicit signal to fall back to fuzzy matching