conjugo 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- conjugo-0.2.1/DATA_LICENSE.md +30 -0
- conjugo-0.2.1/LICENSE +24 -0
- conjugo-0.2.1/PKG-INFO +285 -0
- conjugo-0.2.1/README.md +268 -0
- conjugo-0.2.1/pyproject.toml +47 -0
- conjugo-0.2.1/pyproject.toml.orig +47 -0
- conjugo-0.2.1/src/conj/__init__.py +15 -0
- conjugo-0.2.1/src/conj/build.py +546 -0
- conjugo-0.2.1/src/conj/cli.py +101 -0
- conjugo-0.2.1/src/conj/compound.py +415 -0
- conjugo-0.2.1/src/conj/db.py +202 -0
- conjugo-0.2.1/src/conj/langs/__init__.py +12 -0
- conjugo-0.2.1/src/conj/langs/base.py +72 -0
- conjugo-0.2.1/src/conj/langs/de.py +55 -0
- conjugo-0.2.1/src/conj/langs/en.py +63 -0
- conjugo-0.2.1/src/conj/langs/es.py +57 -0
- conjugo-0.2.1/src/conj/langs/fr.py +51 -0
- conjugo-0.2.1/src/conj/langs/it.py +49 -0
- conjugo-0.2.1/src/conj/langs/pt.py +63 -0
- conjugo-0.2.1/src/conj/langs/ru.py +42 -0
- conjugo-0.2.1/src/conj/link.py +36 -0
- conjugo-0.2.1/src/conj/normalize.py +89 -0
- conjugo-0.2.1/src/conj/pronominal.py +188 -0
- conjugo-0.2.1/src/conj/render.py +126 -0
- conjugo-0.2.1/src/conj/search.py +127 -0
- conjugo-0.2.1/src/conj/tags.py +121 -0
- conjugo-0.2.1/src/conj/tui/__init__.py +0 -0
- conjugo-0.2.1/src/conj/tui/app.py +523 -0
- conjugo-0.2.1/src/conj/tui/app.tcss +111 -0
- conjugo-0.2.1/src/conj/tui/layout.py +131 -0
- conjugo-0.2.1/src/conj/tui/widgets.py +101 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Data license
|
|
2
|
+
|
|
3
|
+
The verb database (`src/conj/data/conj.sqlite.gz`) is a separate work from
|
|
4
|
+
the code. It is licensed under the
|
|
5
|
+
[Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/)
|
|
6
|
+
(CC BY-SA 4.0). If you redistribute the database or anything derived from it,
|
|
7
|
+
you must give attribution and use the same license.
|
|
8
|
+
|
|
9
|
+
## Sources
|
|
10
|
+
|
|
11
|
+
- **Wiktionary** (<https://en.wiktionary.org>): conjugation tables, auxiliaries
|
|
12
|
+
and English glosses for French, Italian, Spanish, Portuguese and English verbs.
|
|
13
|
+
© Wiktionary contributors, CC BY-SA 4.0 (dual-licensed under the GFDL).
|
|
14
|
+
- **Wiktextract / kaikki.org** (<https://kaikki.org>): the machine-readable
|
|
15
|
+
extraction of Wiktionary used as input. Cite as:
|
|
16
|
+
Tatu Ylonen (2022). *Wiktextract: Wiktionary as Machine-Readable Structured
|
|
17
|
+
Data.* Proceedings of LREC 2022, pp. 1317–1325.
|
|
18
|
+
- **wordfreq** (<https://github.com/rspeer/wordfreq>), by Robyn Speer: word
|
|
19
|
+
frequencies used at build time to rank verbs. Data CC BY-SA 4.0.
|
|
20
|
+
|
|
21
|
+
## What `conj-build` changes
|
|
22
|
+
|
|
23
|
+
- It keeps only verbs that have a conjugation table, or English principal parts.
|
|
24
|
+
- It drops forms tagged as archaic, dialectal, obsolete, poetic and similar.
|
|
25
|
+
For Italian it keeps only the first, standard variant in each cell. For
|
|
26
|
+
Spanish it drops voseo (*vos*) forms and keeps the *tú* ones.
|
|
27
|
+
- It converts Wiktionary's stress-marked Italian spelling (*córro*, *pàrla*)
|
|
28
|
+
to standard orthography (*corro*, *parla*).
|
|
29
|
+
- It stores no compound or periphrastic tenses. `conj` builds those at run time
|
|
30
|
+
from the auxiliary's paradigm and the participle.
|
conjugo-0.2.1/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Guilherme D. Garcia
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
Note: this license covers the source code only. The verb database is a
|
|
24
|
+
separate work under CC BY-SA 4.0; see DATA_LICENSE.md.
|
conjugo-0.2.1/PKG-INFO
ADDED
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: conjugo
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Conjugo: terminal verb conjugator for French, Italian, Spanish, Portuguese, English, German and Russian, built on open Wiktionary data
|
|
5
|
+
Author: Guilherme D. Garcia
|
|
6
|
+
Author-email: Guilherme D. Garcia <guilherme.garcia@lli.ulaval.ca>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: DATA_LICENSE.md
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: rapidfuzz>=3.14.6
|
|
11
|
+
Requires-Dist: textual>=8.2.8
|
|
12
|
+
Requires-Python: >=3.12
|
|
13
|
+
Project-URL: Homepage, https://github.com/guilhermegarcia/conj
|
|
14
|
+
Project-URL: Source, https://github.com/guilhermegarcia/conj
|
|
15
|
+
Project-URL: Issues, https://github.com/guilhermegarcia/conj/issues
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# Conjugo
|
|
19
|
+
|
|
20
|
+
Verb conjugation in the terminal for French, Italian, Spanish, Portuguese,
|
|
21
|
+
English, German and Russian, built on open Wiktionary data. It shows every simple and compound
|
|
22
|
+
tense, finds a verb from any of its forms, and runs from the `conj` command.
|
|
23
|
+
|
|
24
|
+
By **Guilherme D. Garcia**. Built with [Claude Code](https://claude.com/claude-code)
|
|
25
|
+
(see [How it was made](#how-it-was-made)).
|
|
26
|
+
|
|
27
|
+

|
|
28
|
+
|
|
29
|
+

|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
conj # open the TUI
|
|
33
|
+
conj venir # open the TUI on a verb
|
|
34
|
+
conj vengo # inflected forms work too: vengo -> venire
|
|
35
|
+
conj -p fr aller # print the paradigm to stdout (no TUI)
|
|
36
|
+
conj -p it correre -a avere # choose the auxiliary for compound tenses
|
|
37
|
+
conj -p pt falar # also es / pt
|
|
38
|
+
conj -p -s went # simple tenses only
|
|
39
|
+
conj -j parlons # JSON, exact matches only (used by the Neovim plugin)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Features
|
|
43
|
+
|
|
44
|
+
- **Coverage:** about 7,500 French, 13,000 Italian, 8,900 Spanish, 6,400
|
|
45
|
+
Portuguese, 57,000 English, 10,300 German and 12,300 Russian verbs. You get every simple tense, plus
|
|
46
|
+
compound tenses built from the right auxiliary with participle agreement
|
|
47
|
+
(*je suis allé(e)*, *noi siamo andati/e*, *he hablado*, *tenho falado*).
|
|
48
|
+
Spanish and Portuguese include the future subjunctive and the negative
|
|
49
|
+
imperative; Portuguese adds the personal infinitive and the simple pluperfect.
|
|
50
|
+
- **German:** Perfekt and Plusquamperfekt with *haben* or *sein*, Futur I
|
|
51
|
+
and II, Konjunktiv I and II with the *würde*-form, and separable verbs
|
|
52
|
+
(*ich stehe auf*, *ich bin aufgestanden*). Verbs that take either
|
|
53
|
+
auxiliary (*fahren*, *aufstehen*) start with *sein*; `a` switches.
|
|
54
|
+
Reflexive verbs come from the base verb: type *sich freuen* for *ich freue
|
|
55
|
+
mich*, *ich habe mich gefreut* (accusative pronouns; dative reflexives such
|
|
56
|
+
as *sich etwas vorstellen* show *mich* too). Search finds
|
|
57
|
+
subordinate-clause forms (*aufstehe*), and *ss* finds *ß*.
|
|
58
|
+
- **Russian:** every verb shows its aspect and its aspect partners
|
|
59
|
+
(*говори́ть*, imperfective; perfective *сказа́ть*, *поговори́ть*), and `p`
|
|
60
|
+
opens the partner (again to cycle through several). The past tense agrees
|
|
61
|
+
in gender, shown in the person table (*я говори́л(а)*, *он говори́л / она
|
|
62
|
+
говори́ла / оно говори́ло*); the conditional adds *бы*. Forms carry stress
|
|
63
|
+
marks; search ignores them, and *е* finds *ё*. Type in Cyrillic.
|
|
64
|
+
- **Pronominal verbs:** *se lever*, *s'en aller*, *alzarsi*, *andarsene*,
|
|
65
|
+
*levantarse*, *levantar-se* and *sich freuen* all work. A French, Spanish or Portuguese
|
|
66
|
+
pronominal that has no table of its own is generated from its base verb.
|
|
67
|
+
Portuguese uses Brazilian clitic placement (*eu me levanto*, *eu tenho me
|
|
68
|
+
levantado*, *levante-se*).
|
|
69
|
+
- **Dual auxiliaries:** verbs like *correre* or *monter* offer both
|
|
70
|
+
auxiliaries. Press `a` to switch.
|
|
71
|
+
- **Reverse lookup:** type any form (*parlerions*, *fusse*, *went*) and the
|
|
72
|
+
matching cell is highlighted.
|
|
73
|
+
- **Dictionary link:** on a Mac with [Lexis](https://github.com/guilhermegarcia/lexis)
|
|
74
|
+
installed, `D` opens the verb's dictionary entries; quitting Lexis brings you
|
|
75
|
+
back. Lexis's `C` does the reverse.
|
|
76
|
+
- **Search:** fuzzy and accent-insensitive (`allr` → *aller*, `parlo` →
|
|
77
|
+
*parlò*). Prefix a query with `fr:`, `it:`, `es:`, `pt:`, `en:`, `de:` or `ru:` to restrict it.
|
|
78
|
+
|
|
79
|
+
### Keys
|
|
80
|
+
|
|
81
|
+
| Key | Action |
|
|
82
|
+
|---|---|
|
|
83
|
+
| type, `↓`, `Enter` | search, move to the results, open a verb |
|
|
84
|
+
| `Esc` | leave the search box (so `Esc` `q` quits) |
|
|
85
|
+
| `/` | back to the search box |
|
|
86
|
+
| `c` | show/hide compound tenses |
|
|
87
|
+
| `a` | switch auxiliary (dual-auxiliary verbs; shown in the footer only for those) |
|
|
88
|
+
| `p` | Russian: open the aspect partner (*говорить* ↔ *сказать*); again to cycle |
|
|
89
|
+
| `Ctrl-h` / `Ctrl-l` | focus the results list / the paradigm (`h` works too) |
|
|
90
|
+
| `j` / `k`, `Ctrl-d` / `Ctrl-u` | down / up in the focused pane (results list or paradigm) |
|
|
91
|
+
| `gg` / `G` | first / last result, or top / bottom of the paradigm |
|
|
92
|
+
| `H` | hide/show the results sidebar |
|
|
93
|
+
| `t` + letter | jump to a tense (each tense shows its letter; `Esc` cancels) |
|
|
94
|
+
| `yy` | copy the selected tense, or the whole paradigm if none is selected |
|
|
95
|
+
| `Y` | copy the whole paradigm as plain text |
|
|
96
|
+
| `1`–`7`, `0` | language filter: fr / it / es / pt / en / de / ru, `0` all (works while typing too) |
|
|
97
|
+
| `D` | define the verb in [Lexis](https://github.com/guilhermegarcia/lexis) (macOS; when it is installed) |
|
|
98
|
+
| `?` | home page with the key list; again to go back to the verb |
|
|
99
|
+
| `q` | quit (asks first: `y`/`q`/`Enter` quits, `n`/`Esc` stays); `Ctrl-q` quits at once |
|
|
100
|
+
| `Ctrl-p` | command palette, including a theme picker that previews each theme |
|
|
101
|
+
|
|
102
|
+
With a Cyrillic (or other non-Latin) keyboard layout active, the keys still
|
|
103
|
+
work: a letter counts as the Latin key in the same place. On macOS the mapping
|
|
104
|
+
comes from the layouts you have enabled, so it is right for Russian ЙЦУКЕН (`о`
|
|
105
|
+
is `j`), Russian – Phonetic (`й` is `j`), Ukrainian and the rest; elsewhere it
|
|
106
|
+
assumes ЙЦУКЕН. Text you type in the search box stays as typed.
|
|
107
|
+
Every key has been checked on Russian – Phonetic and on Russian ЙЦУКЕН.
|
|
108
|
+
|
|
109
|
+
## Install
|
|
110
|
+
|
|
111
|
+
You need [uv](https://docs.astral.sh/uv/). Then:
|
|
112
|
+
|
|
113
|
+
```sh
|
|
114
|
+
uv tool install conjugo
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
That puts `conj` on your PATH. The verb database (~30 MB) isn't in git: on its
|
|
118
|
+
first run `conj` downloads the release made for your version of the code,
|
|
119
|
+
checks its SHA-256, and unpacks it into `~/Library/Caches/conj` (or
|
|
120
|
+
`$XDG_CACHE_HOME/conj`, by default `~/.cache/conj` on Linux). Later runs work offline.
|
|
121
|
+
|
|
122
|
+
To update, run `uv tool upgrade conjugo` (or, from a clone, `git pull && uv tool
|
|
123
|
+
install --reinstall .`). If the new version needs a newer database, it
|
|
124
|
+
downloads it on its next run and deletes the old one. A copy at
|
|
125
|
+
`src/conj/data/conj.sqlite.gz` that isn't the release the code expects is
|
|
126
|
+
ignored.
|
|
127
|
+
|
|
128
|
+
To try it without installing: `uvx --from conjugo conj`.
|
|
129
|
+
|
|
130
|
+
The package is called `conjugo` on PyPI (the name `conj` there belongs to
|
|
131
|
+
another project); the command it installs is `conj`.
|
|
132
|
+
|
|
133
|
+
### Lexis (dictionaries, macOS)
|
|
134
|
+
|
|
135
|
+
[Lexis](https://github.com/guilhermegarcia/lexis) (`lexis`) shows the
|
|
136
|
+
dictionaries enabled in macOS Dictionary.app in the terminal, with the same
|
|
137
|
+
keys as Conjugo. Install both and they link up; nothing needs configuring:
|
|
138
|
+
|
|
139
|
+
```sh
|
|
140
|
+
uv tool install git+https://github.com/guilhermegarcia/lexis
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
- In Conjugo, `D` opens Lexis on the current verb, limited to dictionaries in
|
|
144
|
+
the verb's language. If none is enabled (no Spanish dictionary, say), Lexis
|
|
145
|
+
says so and how to turn one on, rather than showing look-alikes from other
|
|
146
|
+
languages.
|
|
147
|
+
- In Lexis, `C` opens Conjugo on the verb under the cursor (or, from its
|
|
148
|
+
dictionary list, on the headword), with the form highlighted: `C` on
|
|
149
|
+
*parlerions* opens *parler*. If the word isn't a verb, Lexis says "Not a verb."
|
|
150
|
+
- The second app runs in the same terminal while the first waits. Quitting it
|
|
151
|
+
(`q`) brings you back to where you were.
|
|
152
|
+
- `C` and `D` on the verb you came from go back instead of opening another
|
|
153
|
+
app, so `D C D C` switches between the conjugation and the dictionary.
|
|
154
|
+
|
|
155
|
+
`D` appears only when Lexis is installed. Lexis needs macOS; Conjugo doesn't.
|
|
156
|
+
|
|
157
|
+
### Neovim
|
|
158
|
+
|
|
159
|
+
The repo is also a Neovim plugin (0.10 or later). `:Conj` opens a floating
|
|
160
|
+
window with the conjugation of the verb under the cursor, with the form under
|
|
161
|
+
the cursor highlighted. If the word isn't a verb, you get a message instead.
|
|
162
|
+
The plugin only draws the window: the conjugations come from `conj --json`, so
|
|
163
|
+
it needs Conjugo installed (see [Install](#install)), with `conj` on your PATH.
|
|
164
|
+
Without it, `:Conj` reports that it cannot run `conj`. If you have uv but would
|
|
165
|
+
rather not install Conjugo, the plugin can run it through `uvx` instead (it
|
|
166
|
+
downloads Conjugo on first use):
|
|
167
|
+
|
|
168
|
+
```lua
|
|
169
|
+
opts = { cmd = { "uvx", "--from", "conjugo", "conj" } }
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+

|
|
173
|
+
|
|
174
|
+
With lazy.nvim:
|
|
175
|
+
|
|
176
|
+
```lua
|
|
177
|
+
{
|
|
178
|
+
"guilhermegarcia/conj",
|
|
179
|
+
cmd = "Conj",
|
|
180
|
+
keys = { { "\\Lc", "<cmd>Conj<cr>", desc = "conjugate" } },
|
|
181
|
+
opts = { default_lang = "fr" }, -- optional: its verbs listed first
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
`\Lc` puts it in a `\L` ("language") menu next to spell checking and a
|
|
186
|
+
dictionary, the way the author uses it. With which-key, `\L` pops up the
|
|
187
|
+
three options:
|
|
188
|
+
|
|
189
|
+
| Keys | Action |
|
|
190
|
+
|---|---|
|
|
191
|
+
| `\Ls` + `e`/`f`/`i`/`p` | toggle spell checking in English/French/Italian/Portuguese |
|
|
192
|
+
| `\Ld` + `e`/`f`/`i`/`p`/`g`/`s` | define the word under the cursor (…/German/Spanish) |
|
|
193
|
+
| `\Lc` | conjugate the word under the cursor (this plugin) |
|
|
194
|
+
|
|
195
|
+
Only `\Lc` comes with Conjugo; the other two are ordinary mappings in your own
|
|
196
|
+
config. A sketch, with a `def` dictionary command standing in for yours:
|
|
197
|
+
|
|
198
|
+
```lua
|
|
199
|
+
local names = { en = "English", fr = "French", it = "Italian", pt = "Portuguese",
|
|
200
|
+
de = "German", es = "Spanish" }
|
|
201
|
+
require("which-key").add({
|
|
202
|
+
{ "\\L", group = "language" },
|
|
203
|
+
{ "\\Ls", group = "spellcheck" },
|
|
204
|
+
{ "\\Ld", group = "define" },
|
|
205
|
+
})
|
|
206
|
+
for key, lang in pairs({ e = "en", f = "fr", i = "it", p = "pt" }) do
|
|
207
|
+
vim.keymap.set("n", "\\Ls" .. key, function()
|
|
208
|
+
local on = vim.wo.spell and vim.bo.spelllang == lang
|
|
209
|
+
vim.opt_local.spell = not on
|
|
210
|
+
vim.opt_local.spelllang = { lang }
|
|
211
|
+
end, { desc = names[lang] .. " spellcheck" })
|
|
212
|
+
end
|
|
213
|
+
for key, lang in pairs({ e = "en", f = "fr", i = "it", p = "pt", g = "de", s = "es" }) do
|
|
214
|
+
vim.keymap.set("n", "\\Ld" .. key, function()
|
|
215
|
+
vim.cmd("!def -l " .. lang .. " " .. vim.fn.shellescape(vim.fn.expand("<cword>")))
|
|
216
|
+
end, { desc = "Define " .. names[lang] })
|
|
217
|
+
end
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Spell checking and conjugation work together: when spell checking is on in
|
|
221
|
+
one language (`\Lsp`), `\Lc` lists that language's verbs first.
|
|
222
|
+
|
|
223
|
+
`:Conj fr` (or it/es/pt/en/de/ru, or `b:conj_lang`) searches only that language.
|
|
224
|
+
Otherwise every language is searched, and a guessed language's verbs come
|
|
225
|
+
first: the spell-check language (when `'spell'` is on with a single
|
|
226
|
+
`'spelllang'`), else `default_lang` (`opts = { default_lang = "fr" }`).
|
|
227
|
+
|
|
228
|
+
When several verbs have the form (*suis*: *être*, *suivre*; *fui*: *fuir*,
|
|
229
|
+
*ser*, *ir*), the header lists them and `p`/`n` switch between them. In the
|
|
230
|
+
window, `q` or `Esc` closes it. Options, highlight groups: `:help conjugo`.
|
|
231
|
+
|
|
232
|
+
### Building the database yourself
|
|
233
|
+
|
|
234
|
+
From a clone, `uv run conj-build` builds `src/conj/data/conj.sqlite.gz` from
|
|
235
|
+
Wiktionary. It downloads about 250 MB of gzip-compressed Wiktextract dumps
|
|
236
|
+
(2.4 GB unpacked), caches them in `~/.cache/conj-build` (`--refresh` fetches
|
|
237
|
+
fresh copies), and builds the database in about 30 s. `conj` uses a local build
|
|
238
|
+
only once `DATA_TAG`/`DATA_SHA256` in `db.py` match it (`conj-build` prints the
|
|
239
|
+
checksum); until then, point `conj` at it with `CONJ_DB=/path/to/conj.sqlite`.
|
|
240
|
+
|
|
241
|
+
## Development
|
|
242
|
+
|
|
243
|
+
```sh
|
|
244
|
+
uv run pytest # golden tests against the built database
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
The code is organized as follows:
|
|
248
|
+
|
|
249
|
+
| Module | Role |
|
|
250
|
+
|---|---|
|
|
251
|
+
| `build.py` | Wiktextract JSONL → SQLite (tag mapping in `tags.py`, spelling in `normalize.py`) |
|
|
252
|
+
| `langs/` | per-language labels, pronouns, sections, compound tenses |
|
|
253
|
+
| `compound.py` | compound and periphrastic tenses, agreement, clitics |
|
|
254
|
+
| `pronominal.py` | FR/ES/PT pronominals generated from the base verb |
|
|
255
|
+
| `search.py` | lookup: lemma, inflected form, fuzzy |
|
|
256
|
+
| `tui/` | Textual app |
|
|
257
|
+
|
|
258
|
+
To add a language, write `langs/xx.py` and add a source to `build.SOURCES`.
|
|
259
|
+
Any language with Wiktionary conjugation tables (German, Catalan…) can be
|
|
260
|
+
added this way.
|
|
261
|
+
|
|
262
|
+
## How it was made
|
|
263
|
+
|
|
264
|
+
Conjugo was built with [Claude Code](https://claude.com/claude-code),
|
|
265
|
+
Anthropic's coding agent. Guilherme D. Garcia designed the app and directed
|
|
266
|
+
the work: the languages and the open data sources, the linguistic decisions
|
|
267
|
+
(which tenses to show and how to label them, Brazilian clitic placement for
|
|
268
|
+
Portuguese), the interface and its keys, and the review of the output. Claude
|
|
269
|
+
Code wrote most of the code, the tests and the documentation, and investigated
|
|
270
|
+
the Wiktionary data. Commits made with it carry a `Co-Authored-By: Claude`
|
|
271
|
+
line.
|
|
272
|
+
|
|
273
|
+
## Credits
|
|
274
|
+
|
|
275
|
+
- Verb tables, auxiliaries and glosses: [Wiktionary](https://en.wiktionary.org)
|
|
276
|
+
contributors, extracted by [Wiktextract](https://kaikki.org)
|
|
277
|
+
(Tatu Ylonen, LREC 2022).
|
|
278
|
+
- Frequency ranking: [wordfreq](https://github.com/rspeer/wordfreq), by Robyn Speer.
|
|
279
|
+
- Interface: [Textual](https://textual.textualize.io); fuzzy search:
|
|
280
|
+
[RapidFuzz](https://github.com/rapidfuzz/RapidFuzz).
|
|
281
|
+
|
|
282
|
+
## License
|
|
283
|
+
|
|
284
|
+
The code is MIT (`LICENSE`), © 2026 Guilherme D. Garcia. The verb data is
|
|
285
|
+
CC BY-SA 4.0, from Wiktionary contributors via Wiktextract (`DATA_LICENSE.md`).
|
conjugo-0.2.1/README.md
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
# Conjugo
|
|
2
|
+
|
|
3
|
+
Verb conjugation in the terminal for French, Italian, Spanish, Portuguese,
|
|
4
|
+
English, German and Russian, built on open Wiktionary data. It shows every simple and compound
|
|
5
|
+
tense, finds a verb from any of its forms, and runs from the `conj` command.
|
|
6
|
+
|
|
7
|
+
By **Guilherme D. Garcia**. Built with [Claude Code](https://claude.com/claude-code)
|
|
8
|
+
(see [How it was made](#how-it-was-made)).
|
|
9
|
+
|
|
10
|
+

|
|
11
|
+
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
conj # open the TUI
|
|
16
|
+
conj venir # open the TUI on a verb
|
|
17
|
+
conj vengo # inflected forms work too: vengo -> venire
|
|
18
|
+
conj -p fr aller # print the paradigm to stdout (no TUI)
|
|
19
|
+
conj -p it correre -a avere # choose the auxiliary for compound tenses
|
|
20
|
+
conj -p pt falar # also es / pt
|
|
21
|
+
conj -p -s went # simple tenses only
|
|
22
|
+
conj -j parlons # JSON, exact matches only (used by the Neovim plugin)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
- **Coverage:** about 7,500 French, 13,000 Italian, 8,900 Spanish, 6,400
|
|
28
|
+
Portuguese, 57,000 English, 10,300 German and 12,300 Russian verbs. You get every simple tense, plus
|
|
29
|
+
compound tenses built from the right auxiliary with participle agreement
|
|
30
|
+
(*je suis allé(e)*, *noi siamo andati/e*, *he hablado*, *tenho falado*).
|
|
31
|
+
Spanish and Portuguese include the future subjunctive and the negative
|
|
32
|
+
imperative; Portuguese adds the personal infinitive and the simple pluperfect.
|
|
33
|
+
- **German:** Perfekt and Plusquamperfekt with *haben* or *sein*, Futur I
|
|
34
|
+
and II, Konjunktiv I and II with the *würde*-form, and separable verbs
|
|
35
|
+
(*ich stehe auf*, *ich bin aufgestanden*). Verbs that take either
|
|
36
|
+
auxiliary (*fahren*, *aufstehen*) start with *sein*; `a` switches.
|
|
37
|
+
Reflexive verbs come from the base verb: type *sich freuen* for *ich freue
|
|
38
|
+
mich*, *ich habe mich gefreut* (accusative pronouns; dative reflexives such
|
|
39
|
+
as *sich etwas vorstellen* show *mich* too). Search finds
|
|
40
|
+
subordinate-clause forms (*aufstehe*), and *ss* finds *ß*.
|
|
41
|
+
- **Russian:** every verb shows its aspect and its aspect partners
|
|
42
|
+
(*говори́ть*, imperfective; perfective *сказа́ть*, *поговори́ть*), and `p`
|
|
43
|
+
opens the partner (again to cycle through several). The past tense agrees
|
|
44
|
+
in gender, shown in the person table (*я говори́л(а)*, *он говори́л / она
|
|
45
|
+
говори́ла / оно говори́ло*); the conditional adds *бы*. Forms carry stress
|
|
46
|
+
marks; search ignores them, and *е* finds *ё*. Type in Cyrillic.
|
|
47
|
+
- **Pronominal verbs:** *se lever*, *s'en aller*, *alzarsi*, *andarsene*,
|
|
48
|
+
*levantarse*, *levantar-se* and *sich freuen* all work. A French, Spanish or Portuguese
|
|
49
|
+
pronominal that has no table of its own is generated from its base verb.
|
|
50
|
+
Portuguese uses Brazilian clitic placement (*eu me levanto*, *eu tenho me
|
|
51
|
+
levantado*, *levante-se*).
|
|
52
|
+
- **Dual auxiliaries:** verbs like *correre* or *monter* offer both
|
|
53
|
+
auxiliaries. Press `a` to switch.
|
|
54
|
+
- **Reverse lookup:** type any form (*parlerions*, *fusse*, *went*) and the
|
|
55
|
+
matching cell is highlighted.
|
|
56
|
+
- **Dictionary link:** on a Mac with [Lexis](https://github.com/guilhermegarcia/lexis)
|
|
57
|
+
installed, `D` opens the verb's dictionary entries; quitting Lexis brings you
|
|
58
|
+
back. Lexis's `C` does the reverse.
|
|
59
|
+
- **Search:** fuzzy and accent-insensitive (`allr` → *aller*, `parlo` →
|
|
60
|
+
*parlò*). Prefix a query with `fr:`, `it:`, `es:`, `pt:`, `en:`, `de:` or `ru:` to restrict it.
|
|
61
|
+
|
|
62
|
+
### Keys
|
|
63
|
+
|
|
64
|
+
| Key | Action |
|
|
65
|
+
|---|---|
|
|
66
|
+
| type, `↓`, `Enter` | search, move to the results, open a verb |
|
|
67
|
+
| `Esc` | leave the search box (so `Esc` `q` quits) |
|
|
68
|
+
| `/` | back to the search box |
|
|
69
|
+
| `c` | show/hide compound tenses |
|
|
70
|
+
| `a` | switch auxiliary (dual-auxiliary verbs; shown in the footer only for those) |
|
|
71
|
+
| `p` | Russian: open the aspect partner (*говорить* ↔ *сказать*); again to cycle |
|
|
72
|
+
| `Ctrl-h` / `Ctrl-l` | focus the results list / the paradigm (`h` works too) |
|
|
73
|
+
| `j` / `k`, `Ctrl-d` / `Ctrl-u` | down / up in the focused pane (results list or paradigm) |
|
|
74
|
+
| `gg` / `G` | first / last result, or top / bottom of the paradigm |
|
|
75
|
+
| `H` | hide/show the results sidebar |
|
|
76
|
+
| `t` + letter | jump to a tense (each tense shows its letter; `Esc` cancels) |
|
|
77
|
+
| `yy` | copy the selected tense, or the whole paradigm if none is selected |
|
|
78
|
+
| `Y` | copy the whole paradigm as plain text |
|
|
79
|
+
| `1`–`7`, `0` | language filter: fr / it / es / pt / en / de / ru, `0` all (works while typing too) |
|
|
80
|
+
| `D` | define the verb in [Lexis](https://github.com/guilhermegarcia/lexis) (macOS; when it is installed) |
|
|
81
|
+
| `?` | home page with the key list; again to go back to the verb |
|
|
82
|
+
| `q` | quit (asks first: `y`/`q`/`Enter` quits, `n`/`Esc` stays); `Ctrl-q` quits at once |
|
|
83
|
+
| `Ctrl-p` | command palette, including a theme picker that previews each theme |
|
|
84
|
+
|
|
85
|
+
With a Cyrillic (or other non-Latin) keyboard layout active, the keys still
|
|
86
|
+
work: a letter counts as the Latin key in the same place. On macOS the mapping
|
|
87
|
+
comes from the layouts you have enabled, so it is right for Russian ЙЦУКЕН (`о`
|
|
88
|
+
is `j`), Russian – Phonetic (`й` is `j`), Ukrainian and the rest; elsewhere it
|
|
89
|
+
assumes ЙЦУКЕН. Text you type in the search box stays as typed.
|
|
90
|
+
Every key has been checked on Russian – Phonetic and on Russian ЙЦУКЕН.
|
|
91
|
+
|
|
92
|
+
## Install
|
|
93
|
+
|
|
94
|
+
You need [uv](https://docs.astral.sh/uv/). Then:
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
uv tool install conjugo
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
That puts `conj` on your PATH. The verb database (~30 MB) isn't in git: on its
|
|
101
|
+
first run `conj` downloads the release made for your version of the code,
|
|
102
|
+
checks its SHA-256, and unpacks it into `~/Library/Caches/conj` (or
|
|
103
|
+
`$XDG_CACHE_HOME/conj`, by default `~/.cache/conj` on Linux). Later runs work offline.
|
|
104
|
+
|
|
105
|
+
To update, run `uv tool upgrade conjugo` (or, from a clone, `git pull && uv tool
|
|
106
|
+
install --reinstall .`). If the new version needs a newer database, it
|
|
107
|
+
downloads it on its next run and deletes the old one. A copy at
|
|
108
|
+
`src/conj/data/conj.sqlite.gz` that isn't the release the code expects is
|
|
109
|
+
ignored.
|
|
110
|
+
|
|
111
|
+
To try it without installing: `uvx --from conjugo conj`.
|
|
112
|
+
|
|
113
|
+
The package is called `conjugo` on PyPI (the name `conj` there belongs to
|
|
114
|
+
another project); the command it installs is `conj`.
|
|
115
|
+
|
|
116
|
+
### Lexis (dictionaries, macOS)
|
|
117
|
+
|
|
118
|
+
[Lexis](https://github.com/guilhermegarcia/lexis) (`lexis`) shows the
|
|
119
|
+
dictionaries enabled in macOS Dictionary.app in the terminal, with the same
|
|
120
|
+
keys as Conjugo. Install both and they link up; nothing needs configuring:
|
|
121
|
+
|
|
122
|
+
```sh
|
|
123
|
+
uv tool install git+https://github.com/guilhermegarcia/lexis
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
- In Conjugo, `D` opens Lexis on the current verb, limited to dictionaries in
|
|
127
|
+
the verb's language. If none is enabled (no Spanish dictionary, say), Lexis
|
|
128
|
+
says so and how to turn one on, rather than showing look-alikes from other
|
|
129
|
+
languages.
|
|
130
|
+
- In Lexis, `C` opens Conjugo on the verb under the cursor (or, from its
|
|
131
|
+
dictionary list, on the headword), with the form highlighted: `C` on
|
|
132
|
+
*parlerions* opens *parler*. If the word isn't a verb, Lexis says "Not a verb."
|
|
133
|
+
- The second app runs in the same terminal while the first waits. Quitting it
|
|
134
|
+
(`q`) brings you back to where you were.
|
|
135
|
+
- `C` and `D` on the verb you came from go back instead of opening another
|
|
136
|
+
app, so `D C D C` switches between the conjugation and the dictionary.
|
|
137
|
+
|
|
138
|
+
`D` appears only when Lexis is installed. Lexis needs macOS; Conjugo doesn't.
|
|
139
|
+
|
|
140
|
+
### Neovim
|
|
141
|
+
|
|
142
|
+
The repo is also a Neovim plugin (0.10 or later). `:Conj` opens a floating
|
|
143
|
+
window with the conjugation of the verb under the cursor, with the form under
|
|
144
|
+
the cursor highlighted. If the word isn't a verb, you get a message instead.
|
|
145
|
+
The plugin only draws the window: the conjugations come from `conj --json`, so
|
|
146
|
+
it needs Conjugo installed (see [Install](#install)), with `conj` on your PATH.
|
|
147
|
+
Without it, `:Conj` reports that it cannot run `conj`. If you have uv but would
|
|
148
|
+
rather not install Conjugo, the plugin can run it through `uvx` instead (it
|
|
149
|
+
downloads Conjugo on first use):
|
|
150
|
+
|
|
151
|
+
```lua
|
|
152
|
+
opts = { cmd = { "uvx", "--from", "conjugo", "conj" } }
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+

|
|
156
|
+
|
|
157
|
+
With lazy.nvim:
|
|
158
|
+
|
|
159
|
+
```lua
|
|
160
|
+
{
|
|
161
|
+
"guilhermegarcia/conj",
|
|
162
|
+
cmd = "Conj",
|
|
163
|
+
keys = { { "\\Lc", "<cmd>Conj<cr>", desc = "conjugate" } },
|
|
164
|
+
opts = { default_lang = "fr" }, -- optional: its verbs listed first
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
`\Lc` puts it in a `\L` ("language") menu next to spell checking and a
|
|
169
|
+
dictionary, the way the author uses it. With which-key, `\L` pops up the
|
|
170
|
+
three options:
|
|
171
|
+
|
|
172
|
+
| Keys | Action |
|
|
173
|
+
|---|---|
|
|
174
|
+
| `\Ls` + `e`/`f`/`i`/`p` | toggle spell checking in English/French/Italian/Portuguese |
|
|
175
|
+
| `\Ld` + `e`/`f`/`i`/`p`/`g`/`s` | define the word under the cursor (…/German/Spanish) |
|
|
176
|
+
| `\Lc` | conjugate the word under the cursor (this plugin) |
|
|
177
|
+
|
|
178
|
+
Only `\Lc` comes with Conjugo; the other two are ordinary mappings in your own
|
|
179
|
+
config. A sketch, with a `def` dictionary command standing in for yours:
|
|
180
|
+
|
|
181
|
+
```lua
|
|
182
|
+
local names = { en = "English", fr = "French", it = "Italian", pt = "Portuguese",
|
|
183
|
+
de = "German", es = "Spanish" }
|
|
184
|
+
require("which-key").add({
|
|
185
|
+
{ "\\L", group = "language" },
|
|
186
|
+
{ "\\Ls", group = "spellcheck" },
|
|
187
|
+
{ "\\Ld", group = "define" },
|
|
188
|
+
})
|
|
189
|
+
for key, lang in pairs({ e = "en", f = "fr", i = "it", p = "pt" }) do
|
|
190
|
+
vim.keymap.set("n", "\\Ls" .. key, function()
|
|
191
|
+
local on = vim.wo.spell and vim.bo.spelllang == lang
|
|
192
|
+
vim.opt_local.spell = not on
|
|
193
|
+
vim.opt_local.spelllang = { lang }
|
|
194
|
+
end, { desc = names[lang] .. " spellcheck" })
|
|
195
|
+
end
|
|
196
|
+
for key, lang in pairs({ e = "en", f = "fr", i = "it", p = "pt", g = "de", s = "es" }) do
|
|
197
|
+
vim.keymap.set("n", "\\Ld" .. key, function()
|
|
198
|
+
vim.cmd("!def -l " .. lang .. " " .. vim.fn.shellescape(vim.fn.expand("<cword>")))
|
|
199
|
+
end, { desc = "Define " .. names[lang] })
|
|
200
|
+
end
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Spell checking and conjugation work together: when spell checking is on in
|
|
204
|
+
one language (`\Lsp`), `\Lc` lists that language's verbs first.
|
|
205
|
+
|
|
206
|
+
`:Conj fr` (or it/es/pt/en/de/ru, or `b:conj_lang`) searches only that language.
|
|
207
|
+
Otherwise every language is searched, and a guessed language's verbs come
|
|
208
|
+
first: the spell-check language (when `'spell'` is on with a single
|
|
209
|
+
`'spelllang'`), else `default_lang` (`opts = { default_lang = "fr" }`).
|
|
210
|
+
|
|
211
|
+
When several verbs have the form (*suis*: *être*, *suivre*; *fui*: *fuir*,
|
|
212
|
+
*ser*, *ir*), the header lists them and `p`/`n` switch between them. In the
|
|
213
|
+
window, `q` or `Esc` closes it. Options, highlight groups: `:help conjugo`.
|
|
214
|
+
|
|
215
|
+
### Building the database yourself
|
|
216
|
+
|
|
217
|
+
From a clone, `uv run conj-build` builds `src/conj/data/conj.sqlite.gz` from
|
|
218
|
+
Wiktionary. It downloads about 250 MB of gzip-compressed Wiktextract dumps
|
|
219
|
+
(2.4 GB unpacked), caches them in `~/.cache/conj-build` (`--refresh` fetches
|
|
220
|
+
fresh copies), and builds the database in about 30 s. `conj` uses a local build
|
|
221
|
+
only once `DATA_TAG`/`DATA_SHA256` in `db.py` match it (`conj-build` prints the
|
|
222
|
+
checksum); until then, point `conj` at it with `CONJ_DB=/path/to/conj.sqlite`.
|
|
223
|
+
|
|
224
|
+
## Development
|
|
225
|
+
|
|
226
|
+
```sh
|
|
227
|
+
uv run pytest # golden tests against the built database
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
The code is organized as follows:
|
|
231
|
+
|
|
232
|
+
| Module | Role |
|
|
233
|
+
|---|---|
|
|
234
|
+
| `build.py` | Wiktextract JSONL → SQLite (tag mapping in `tags.py`, spelling in `normalize.py`) |
|
|
235
|
+
| `langs/` | per-language labels, pronouns, sections, compound tenses |
|
|
236
|
+
| `compound.py` | compound and periphrastic tenses, agreement, clitics |
|
|
237
|
+
| `pronominal.py` | FR/ES/PT pronominals generated from the base verb |
|
|
238
|
+
| `search.py` | lookup: lemma, inflected form, fuzzy |
|
|
239
|
+
| `tui/` | Textual app |
|
|
240
|
+
|
|
241
|
+
To add a language, write `langs/xx.py` and add a source to `build.SOURCES`.
|
|
242
|
+
Any language with Wiktionary conjugation tables (German, Catalan…) can be
|
|
243
|
+
added this way.
|
|
244
|
+
|
|
245
|
+
## How it was made
|
|
246
|
+
|
|
247
|
+
Conjugo was built with [Claude Code](https://claude.com/claude-code),
|
|
248
|
+
Anthropic's coding agent. Guilherme D. Garcia designed the app and directed
|
|
249
|
+
the work: the languages and the open data sources, the linguistic decisions
|
|
250
|
+
(which tenses to show and how to label them, Brazilian clitic placement for
|
|
251
|
+
Portuguese), the interface and its keys, and the review of the output. Claude
|
|
252
|
+
Code wrote most of the code, the tests and the documentation, and investigated
|
|
253
|
+
the Wiktionary data. Commits made with it carry a `Co-Authored-By: Claude`
|
|
254
|
+
line.
|
|
255
|
+
|
|
256
|
+
## Credits
|
|
257
|
+
|
|
258
|
+
- Verb tables, auxiliaries and glosses: [Wiktionary](https://en.wiktionary.org)
|
|
259
|
+
contributors, extracted by [Wiktextract](https://kaikki.org)
|
|
260
|
+
(Tatu Ylonen, LREC 2022).
|
|
261
|
+
- Frequency ranking: [wordfreq](https://github.com/rspeer/wordfreq), by Robyn Speer.
|
|
262
|
+
- Interface: [Textual](https://textual.textualize.io); fuzzy search:
|
|
263
|
+
[RapidFuzz](https://github.com/rapidfuzz/RapidFuzz).
|
|
264
|
+
|
|
265
|
+
## License
|
|
266
|
+
|
|
267
|
+
The code is MIT (`LICENSE`), © 2026 Guilherme D. Garcia. The verb data is
|
|
268
|
+
CC BY-SA 4.0, from Wiktionary contributors via Wiktextract (`DATA_LICENSE.md`).
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "conjugo"
|
|
3
|
+
version = "0.2.1"
|
|
4
|
+
description = "Conjugo: terminal verb conjugator for French, Italian, Spanish, Portuguese, English, German and Russian, built on open Wiktionary data"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
license-files = [
|
|
8
|
+
"LICENSE",
|
|
9
|
+
"DATA_LICENSE.md",
|
|
10
|
+
]
|
|
11
|
+
requires-python = ">=3.12"
|
|
12
|
+
dependencies = [
|
|
13
|
+
"rapidfuzz>=3.14.6",
|
|
14
|
+
"textual>=8.2.8",
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
[[project.authors]]
|
|
18
|
+
name = "Guilherme D. Garcia"
|
|
19
|
+
email = "guilherme.garcia@lli.ulaval.ca"
|
|
20
|
+
|
|
21
|
+
[project.scripts]
|
|
22
|
+
conj = "conj.cli:main"
|
|
23
|
+
conj-build = "conj.build:main"
|
|
24
|
+
|
|
25
|
+
[project.urls]
|
|
26
|
+
Homepage = "https://github.com/guilhermegarcia/conj"
|
|
27
|
+
Source = "https://github.com/guilhermegarcia/conj"
|
|
28
|
+
Issues = "https://github.com/guilhermegarcia/conj/issues"
|
|
29
|
+
|
|
30
|
+
[build-system]
|
|
31
|
+
requires = ["uv_build>=0.13.9,<0.14.0"]
|
|
32
|
+
build-backend = "uv_build"
|
|
33
|
+
|
|
34
|
+
[tool.uv]
|
|
35
|
+
default-groups = [
|
|
36
|
+
"dev",
|
|
37
|
+
"build",
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
[tool.uv.build-backend]
|
|
41
|
+
module-name = "conj"
|
|
42
|
+
source-exclude = ["**/conj.sqlite.gz"]
|
|
43
|
+
wheel-exclude = ["**/conj.sqlite.gz"]
|
|
44
|
+
|
|
45
|
+
[dependency-groups]
|
|
46
|
+
dev = ["pytest>=9.2.0"]
|
|
47
|
+
build = ["wordfreq>=3.1.1"]
|