Lightweight HTTP API wrapper around Korektor for Czech spellchecking.
Uses Korektor to generate corrected text and exposes structured matches similar to LanguageTool.
- Czech spellchecking using Korektor
- Returns corrected text and structured matches
- Match format includes offset, length, original text, and replacement
- Docker-ready
- Simple health check endpoint
Check text and return suggested corrections.
{
"text": "Tohle je spatne napsana veta."
}{
"text": "Tohle je spatne napsana veta.",
"corrected_text": "Tohle je spatně napsaná veta.",
"matches": [
{
"message": "Replace \"spatne\" with \"spatně\".",
"offset": 8,
"length": 6,
"original": "spatne",
"replacement": "spatně",
"issue_type": "misspelling"
}
]
}Health check endpoint.
{
"ok": true
}Korektor produces a corrected sentence.
This API compares the original and corrected text and extracts differences as structured matches.
- Changes are expanded to whole words
- Multiple character edits inside one word are merged
- misspelling – word-level correction
- punctuation – punctuation changes
- spacing – whitespace adjustments
- unknown – fallback category
Build:
docker build -t korektor-service .
Run:
docker run -p 8010:8010 korektor-service
Custom port:
docker run -e PORT=8080 -p 8080:8080 korektor-service
docker compose up --build
Linux / macOS:
curl -X POST http://localhost:8010/check \
-H "Content-Type: application/json" \
-d '{"text":"Tohle je spatne napsana veta."}'
Windows (CMD):
curl -X POST http://localhost:8010/check -H "Content-Type: application/json" -d "{\"text\":\"Tohle je spatne napsana veta.\"}"
- Korektor provides only one corrected variant
- No grammar explanations
- Diff-based matching may be imperfect for complex rewrites
- Designed for suggestions, not full grammar validation
This service uses Korektor developed by the Institute of Formal and Applied Linguistics, Charles University.
- Korektor: BSD-2-Clause
- Czech models: check UFAL license (may be non-commercial)