# facet-singularize
Fast, no-regex English singularization for the facet ecosystem.
## Features
- **No regex** - Uses simple string operations for performance in hot paths
- **No allocations** with `is_singular_of()` - Perfect for deserialization matching
- **Handles common cases**:
- Irregular plurals (children → child, people → person)
- `-ies` → `-y` (dependencies → dependency)
- `-ves` → `-f`/`-fe` (wolves → wolf, knives → knife)
- `-es` for sibilants (boxes → box, matches → match)
- Simple `-s` removal (items → item)
- **no_std** compatible
## Usage
```rust
use facet_singularize::{singularize, is_singular_of};
// Convert plural to singular
assert_eq!(singularize("dependencies"), "dependency");
assert_eq!(singularize("children"), "child");
assert_eq!(singularize("boxes"), "box");
// Check if a word is the singular of another (allocation-free)
assert!(is_singular_of("dependency", "dependencies"));
assert!(is_singular_of("child", "children"));
```
## Use Case
This crate is primarily used by `facet-kdl` for matching KDL node names to Rust field names:
```rust
#[derive(Facet)]
struct Config {
#[facet(kdl::children)]
dependencies: Vec<Dependency>, // Matches "dependency" nodes
}
```