soju translate-words

Purpose: Turn a plain-text word list into soju import JSON via Ollama (romanization, English gloss, optional examples). Pipe stdout into soju import, or write with --output.

Reads

Plain-text --file; registry (for --skip-existing)

Writes

Nothing (stdout or --output JSON only)

Exit codes

0 success · non-zero on error

                                                                              
 Usage: soju translate-words [OPTIONS]                                        
                                                                              
 Translate a plain-text word list into soju import JSON via Ollama.           
                                                                              
╭─ Options ──────────────────────────────────────────────────────────────────╮
│ *  --file           -f      <path>   Plain-text word list file             │
│                                      [required]                            │
│    --output         -o      <path>   Write JSON to this file instead of    │
│                                      stdout                                │
│    --model                  <str>    Ollama model name                     │
│                                      [default: gemma4:e4b]                 │
│    --base-url               <str>    Ollama base URL                       │
│                                      [default: http://localhost:11434]     │
│    --batch-size             <int>    Lines per Ollama request              │
│                                      [default: 8]                          │
│    --temperature            <float>  Sampling temperature                  │
│                                      [default: 0.3]                        │
│    --skip-existing                   Omit entries already in the registry  │
│    --level                  <str>    Course level (default:                │
│                                      SOJU_LANGUAGE_LEVEL or 1A; see        │
│                                      data/content/levels.yaml)             │
│    --dry-run                         Parse input and print summary without │
│                                      calling Ollama                        │
│    --help                            Show this message and exit.           │
╰────────────────────────────────────────────────────────────────────────────╯
uv run soju translate-words --file words.txt | uv run soju import words --topic common --stdin-json
uv run poe translate-words --file words.txt
uv run soju translate-words --file words.txt --dry-run
uv run soju translate-words --file words.txt --skip-existing -o records.json

Requires a reachable Ollama (or compatible) server unless --dry-run. Level defaults to SOJU_LANGUAGE_LEVEL or 1A.