包含函數共軛物的類共軛器,該功能通過時態,情緒和代詞結合西班牙語動詞。
pip install spanishconjugator
python用法示例; Conjugator類別的conjugate函數分別為根動詞,時態,情緒,代詞
from spanishconjugator import Conjugator
imperfect_conjugation = Conjugator (). conjugate ( 'hablar' , 'imperfect' , 'indicative' , 'yo' )
print ( imperfect_conjugation )
> >> hablaba 所有代詞均已實現yo, tu, usted, nosotros, vosotros, ustedes
當前實施的所有情緒都是indicative, conditional
目前實施的所有時態都present, imperfect, preterite, future, present_perfect, past_anterior, future_perfect, conditional_simple
與hablar和yo的不同情緒/時態的使用
Conjugator (). conjugate ( 'hablar' , 'present' , 'indicative' , 'yo' )
> >> hablo如果存在指示性,則第4個參數代詞是可選的。
from spanishconjugator import Conjugator
present_indicative_conjugation = Conjugator (). conjugate ( 'hablar' , 'present' , 'indicative' )
print ( present_indicative_conjugation )
> >> { 'el/ella/usted' : 'habla' , 'ellos/ellas/ustedes' : 'hablan' , 'tu' : 'hablas' , 'vosotros' : 'habláis' , 'yo' : 'hablo' , 'nosotros' : 'hablamos' } Conjugator (). conjugate ( 'hablar' , 'imperfect' , 'indicative' , 'yo' )
> >> hablaba Conjugator (). conjugate ( 'hablar' , 'preterite' , 'indicative' , 'yo' )
> >> hablé Conjugator (). conjugate ( 'hablar' , 'future' , 'indicative' , 'yo' )
> >> hablaré Conjugator (). conjugate ( 'hablar' , 'present_perfect' , 'indicative' , 'yo' )
> >> he hablado Conjugator (). conjugate ( 'hablar' , 'past_anterior' , 'indicative' , 'yo' )
> >> hube hablado Conjugator (). conjugate ( 'hablar' , 'future_perfect' , 'indicative' , 'yo' )
> >> habré hablado Conjugator (). conjugate ( 'hablar' , 'simple_conditional' , 'conditional' , 'yo' )
> >> hablaría Conjugator (). conjugate ( 'hablar' , 'perfect' , 'conditional' , 'yo' )
> >> habría hablado Conjugator (). conjugate ( 'hablar' , 'affirmative' , 'imperative' , 'tu' )
> >> habla Conjugator (). conjugate ( 'hablar' , 'negative' , 'imperative' , 'tu' )
> >> hables Conjugator (). conjugate ( 'hablar' , 'present' , 'subjunctive' , 'yo' )
> >> hable Conjugator (). conjugate ( 'hablar' , 'imperfect' , 'subjunctive' , 'yo' )
> >> hablara Conjugator (). conjugate ( 'hablar' , 'imperfect_se' , 'subjunctive' , 'yo' )
> >> hablase Conjugator (). conjugate ( 'hablar' , 'future' , 'subjunctive' , 'yo' )
> >> hablare 如果您想幫助開發西班牙判斷器,請遵循隨後的代碼
雖然在命令行中創建了一個您想要工作的文件夾(只有名稱)
$ mkdir spanish_conjugator_enviroment
將目錄更改為您剛剛製作的環境
$ cd spanish_conjugator_enviroment
安裝Virtualenv
$ pip install virtualenv
從python3的路徑中創建一個虛擬環境
$ virtualenv -p $(which python3) my_venv
激活虛擬環境
$ source my_venv/bin/activate
提示:一旦您想解散虛擬環境,只需運行
$ deactivate
克隆西班牙綴合物
$ git clone https://github.com/Benedict-Carling/spanish-conjugator.git
安裝用於單位測試的開發人員依賴項,例如Pytest和其他庫工具
pip install -e .[dev]
我們選擇使用庫Pytest進行我們的單元測試,此時在“開髮指南”中您可以通過在/tests文件夾中的當前單元測試來檢查代碼的工作原理。
$ pytest
輸出應表明實施的時態應如下通過其單位測試。 (27/08/2020) 
要向此存儲庫提交代碼,請分叉並提交拉動請求
如果您在節點或瀏覽器enviroment中工作,請查看庫的JavaScript NPM版本
https://github.com/benedict-carling/spanish-conjugatorjs