Skip to content

Commit 9ef958c

Browse files
committed
updated readme
1 parent e359548 commit 9ef958c

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

README.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,32 @@ Examples:
107107
### Multi-Language Conjugation
108108

109109
```python
110-
>>> from verbecc import Conjugator
111-
>>> Conjugator('fr').conjugate('etre')['moods']['indicatif']['présent']
110+
>>> from functools import partial
111+
>>> from verbecc import Conjugator, grammar_defines, LangCodeISO639_1 as Lang
112+
>>> conjugators = {lang : Conjugator(lang) for lang in grammar_defines.SUPPORTED_LANGUAGES}
113+
>>> conj_fr = conjugators[Lang.fr].conjugate
114+
>>> conj_pt = conjugators[Lang.pt].conjugate
115+
>>> conj_ro = conjugators[Lang.ro].conjugate
116+
>>> conj_ca = conjugators[Lang.ca].conjugate
117+
>>> conj_es = conjugators[Lang.es].conjugate
118+
>>> conj_es = conjugators[Lang.es].conjugate
119+
>>> conj_es_voseo = partial(conj_es, lang_specific_options=LangSpecificOptionsEs(VoseoOptions.VoseoTipo3))
120+
121+
>>> conj_fr('etre')['moods']['indicatif']['présent']
112122
['je suis', 'tu es', 'il est', 'nous sommes', 'vous êtes', 'ils sont']
113-
>>> Conjugator('es').conjugate('ser')['moods']['indicativo']['presente']
114-
['yo soy', 'tú eres', 'él es', 'nosotros somos', 'vosotros sois', 'ellos son']
115-
>>> Conjugator('pt').conjugate('ser')['moods']['indicativo']['presente']
123+
>>> conj_pt('ser')['moods']['indicativo']['presente']
116124
['eu sou', 'tu és', 'ele é', 'nós somos', 'vós sois', 'eles são']
117-
>>> Conjugator('ca').conjugate('ser')['moods']['indicatiu']['present']
125+
>>> conj_ca('ser')['moods']['indicatiu']['present']
118126
['jo sóc', 'tu ets', 'ell és', 'nosaltres som', 'vosaltres sou', 'ells són']
119-
>>> Conjugator('it').conjugate('essere')['moods']['indicativo']['presente']
127+
>>> conj_it('essere')['moods']['indicativo']['presente']
120128
['io sono', 'tu sei', 'lui è', 'noi siamo', 'voi siete', 'loro sono']
121-
>>> Conjugator('ro').conjugate('fi')['moods']['indicativ']['prezent']
129+
>>> conj_ro('fi')['moods']['indicativ']['prezent']
122130
['eu sunt', 'tu ești', 'el e', 'noi suntem', 'voi sunteţi', 'ei sunt']
131+
>>> conj_es('ser')['moods']['indicativo']['presente']
132+
['yo soy', 'tú eres', 'él es', 'nosotros somos', 'vosotros sois', 'ellos son']
133+
>>> conj_es_voseo('ser')['moods']['indicativo']['presente']
134+
['yo soy', 'vos sois', 'él es', 'nosotros somos', 'vosotros sois', 'ellos son']
135+
123136
```
124137

125138
### Multi-Language Conjugation using EN mood and tense names via localization module

0 commit comments

Comments
 (0)