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 |
Metadata
Release files for inflecteur 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| inflecteur-0.1.4.tar.gz | 6.9 kB | Without provenance | Details for inflecteur-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| inflecteur-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for inflecteur-0.1.4-py3-none-any.whl |
Total release size: 13.9 kB
Release files / inflecteur-0.1.4.tar.gz
| Download URL | inflecteur-0.1.4.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3f9c3e16f79dc3ff5c4da1d95ed2f0b7d08fa4435719788d7370586a1582959c
|
|
BLAKE2b-256 checksum How to use checksums |
d1b9840f8bbbff4c0ba87f2bc44e966fff7311e34e2dc9c892dfda306892831e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / inflecteur-0.1.4-py3-none-any.whl
| Download URL | inflecteur-0.1.4-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b6cfd259d19e766c2b3e5f65caa863458b08c51a821dea37cc97caf35f59b1e9
|
|
BLAKE2b-256 checksum How to use checksums |
0b629863e01952f311437fb6fc20381c5761686453e3c7048ebb8ca547ce11fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for inflecteur 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.