python inflector for French language : control gender, tense and number
Project description
inflecteur
inflecteur is a python inflector for french language based on the DELA dictionary
Installation :
$ pip install -U transformers
$ pip install -U inflecteur
How to inflect ?
In [1]: from inflecteur import inflecteur
In [2]: inflecteur = inflecteur()
In [3]: inflecteur.load_dict()
Control tense :
In [4]: inflecteur.inflect_sentence("Elle boit un café et mange un croissant.", tense='Futur')
'Elle boira un café et mangera un croissant .'
In [5]: inflecteur.inflect_sentence("Elle boit un café et mange un croissant.", tense='Passé simple')
'Elle but un café et mangea un croissant .'
Control gender :
In [6]: inflecteur.inflect_sentence("Elle boit un café et mange un croissant.", gender='m')
'Il boit un café et mange un croissant .'
Control number :
In [7]: inflecteur.inflect_sentence("Elle boit un café et mange un croissant.", number='p')
'Elles boivent des cafés et mangent des croissants .'
Get word forms :
In [8]: inflecteur.get_word_form('pris')
| lemma | gram | forme | gender | number | tense | person | |
|---|---|---|---|---|---|---|---|
| 0 | prendre | Verbe | Kms | M | singular | Passé composé | |
| 1 | prendre | Verbe | Kmp | M | plural | Passé composé | |
| 2 | prendre | Verbe | J1s | singular | Passé simple | Je | |
| 3 | prendre | Verbe | J2s | singular | Passé simple | Tu | |
| 4 | prendre | Verbe | Kms | M | singular | Passé composé | |
| 5 | prendre | Verbe | J1s | singular | Passé simple | Je | |
| 6 | prendre | Verbe | J2s | singular | Passé simple | Tu | |
| 7 | pris | Adjectif | ms | M | singular | ||
| 8 | pris | Adjectif | mp | M | plural |
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
inflecteur-0.1.4.tar.gz
(6.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file inflecteur-0.1.4.tar.gz.
File metadata
- Download URL: inflecteur-0.1.4.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f9c3e16f79dc3ff5c4da1d95ed2f0b7d08fa4435719788d7370586a1582959c
|
|
| MD5 |
0f5ff0d60325557e7d55c9473d6519db
|
|
| BLAKE2b-256 |
d1b9840f8bbbff4c0ba87f2bc44e966fff7311e34e2dc9c892dfda306892831e
|
File details
Details for the file inflecteur-0.1.4-py3-none-any.whl.
File metadata
- Download URL: inflecteur-0.1.4-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6cfd259d19e766c2b3e5f65caa863458b08c51a821dea37cc97caf35f59b1e9
|
|
| MD5 |
c3332d82fb549fe19cacdbba114ba310
|
|
| BLAKE2b-256 |
0b629863e01952f311437fb6fc20381c5761686453e3c7048ebb8ca547ce11fc
|