blob: e73b06f6edb113b10c6ada97de15f3212a3ad5b2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
// This program looks up words fromm Wiktionary, and creates Anki flashcards
// from them.
package main
import (
"log"
"net/http"
"time"
tea "github.com/charmbracelet/bubbletea"
_ "github.com/mattn/go-sqlite3"
)
const (
rawDictionary = "/home/david/work/french-wiktionary-flashcards/raw-wiktextract-data.jsonl"
dictionary = "dictionary.sqlite3"
apiURL = "http://localhost:8765"
deckName = "Français"
modelName = "Basic-830ae"
)
func main() {
db, err := setupDatabase()
if err != nil {
log.Fatalf("setting up database: %s", err)
}
defer db.Close()
c := http.DefaultClient
c.Timeout = 5 * time.Second
p := tea.NewProgram(initialModel(c, db))
if _, err := p.Run(); err != nil {
log.Fatal(err)
}
}
|