Skip to content

Commit

Permalink
Instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaliniR8 committed Jan 4, 2025
1 parent 79e36f4 commit 5a13fc1
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Number to Words Contextual Library
# MathSpell

This library converts numbers to words based on their context. For example:
- For years: "2015" -> "twenty fifteen"
- For quantities: "2015" -> "two thousand and fifteen"
MathSpell is a Python package for converting numbers into contextually appropriate words, such as "twenty-first century" for years or "two thousand and twenty-three" for general numbers.

## Installation

1. Install the package:
```bash
pip install mathspell
```

2. Download the required spaCy language model:
```bash
python -m spacy download en_core_web_sm
```

## Usage

After installation, you can use MathSpell to process text containing numbers. For example:

```python
from mathspell import analyze_text
text = "This is the 21st century. I was born in 1995."
converted_text = analyze_text(text)
print(converted_text)
# Output: "This is the twenty-first century. I was born in nineteen ninety-five."

0 comments on commit 5a13fc1

Please sign in to comment.