fuzzymonth π
A robust, user-friendly Rust library for parsing month names with built-in fuzzy matching. It handles various formats, typos, and international month names.
Features
- β¨ Fuzzy matching for typos and misspellings
- π International support (Spanish, French, German, Italian, Polish, Russian, Arabic, Chinese)
- π Multiple input formats:
- Full names ("January", "February")
- Common abbreviations ("Jan", "Feb", "Sept")
- Numbers ("1", "01")
- Ordinal numbers ("1st", "2nd", "3rd")
- π§Ή Automatic cleanup of input (whitespace trimming, case-insensitive)
- πͺ Extensively tested with property-based tests and fuzzing
Usage
Add to your Cargo.toml:
[]
= "0.1.0"
Basic usage:
use ;
How It Works
The library uses a multi-step approach to parse month names:
- Exact matching against known formats
- Number parsing (including ordinal numbers)
- International variant matching
- Fuzzy matching using Levenshtein distance for typo tolerance
Testing
The library is extensively tested with:
- Comprehensive unit tests covering all supported formats
- Property-based tests for fuzzy matching consistency
- Edge case testing for special characters and mixed inputs
- International format validation
- Extensive fuzzing to ensure robustness
Contributing
Contributions are welcome! Here are some ways you can help:
- Add support for more languages and regional formats
- Contribute common misspellings or abbreviations from your locale
- Add new test cases for edge cases you've encountered
- Improve fuzzy matching accuracy
- Add new input formats
Please ensure tests pass and add new tests for any added functionality.
License
Built with π for real-world month parsing. Because dates are hard, and users are creative.