https://github.com/tomaarsen/inflex
Natural Language Inflection in English
https://github.com/tomaarsen/inflex
conjugation convert converter declension inflect inflection inflections inflex morphological-analysis morphological-generation nlp python
Last synced: 5 months ago
JSON representation
Natural Language Inflection in English
- Host: GitHub
- URL: https://github.com/tomaarsen/inflex
- Owner: tomaarsen
- License: gpl-3.0
- Created: 2020-09-09T21:38:06.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-01-10T15:12:57.000Z (over 3 years ago)
- Last Synced: 2025-04-13T13:40:26.875Z (6 months ago)
- Topics: conjugation, convert, converter, declension, inflect, inflection, inflections, inflex, morphological-analysis, morphological-generation, nlp, python
- Language: Python
- Homepage: https://www.tomaarsen.com/projects/inflex/try
- Size: 5.24 MB
- Stars: 11
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Inflex
Natural Language Inflection in English
(Formerly called Inflexion)## Overview
The Inflex module is a rule-based morphological analyser and generator. It allows for conversions of any noun, verb or adjective to a specific wordform such as singular, plural, past, past participle or present participle.
Inflex can be tried out and compared against competitors including ``nltk``, ``textblob``, ``pattern``, ``inflect``, ``inflection``, ``inflector``, ``lemminflect``, and ``pyinflect`` on https://www.tomaarsen.com/projects/inflex/try. Furthermore, the comparison of performance of all of these modules is visualised on https://www.tomaarsen.com/projects/inflex/performance, using several different datasets. These results show that Inflex outperforms all existing modules for noun conversions, and performs competitively for verbs. This website also contains the thesis out of which Inflex (formerly called Inflexion) was born.
The Inflex documentation can be found [here](https://tomaarsen.github.io/Inflex/), alongside a [Quick Reference](https://tomaarsen.github.io/Inflex/reference.html).
## Sample Usage
To give a quick idea of this project, this is an example usage of Inflex:
```python
from inflex import Noun, Verb, Adjective# Converting Nouns
Noun("book").plural() # Produces "books"
Noun("book").singular() # Produces "book"# Converting Verbs
Verb("fly").plural() # Produces "fly"
Verb("fly").singular() # Produces "flies"
Verb("fly").past() # Produces "flew"
Verb("fly").pres_part() # Produces "flying"
Verb("fly").past_part() # Produces "flown"# Converting Adjectives
Adjective("my").singular() # Produces "my"
Adjective("our").plural() # Produces "our"
Adjective("small").comparative() # Produces "smallest"
Adjective("small").superlative() # Produces "smaller"
```## Install
Inflex has no requirements, and has support for Python version 3.6 onwards.
Install it via:
```
pip install inflex
```