This is a simple FastAPI application to decline Russian words.
-
Build the Docker image:
docker build -t russian-cases-api . -
Run the Docker container:
docker run -p 80:80 russian-cases-api
The API will be available at http://localhost.
The root endpoint can be used as a health check:
The API has the following endpoints to decline a word (q parameter) into a specific case:
/{case}: Returns the word declined in the specified case.
nomn(Именительный)gent(Родительный)datv(Дательный)accs(Винительный)ablt(Творительный)loct(Предложный)all(Returns all cases)
curl "http://localhost/gent?q=слово"Response:
{
"result": "слова",
"time": 0.000123456
}curl "http://localhost/all?q=слово"Response:
{
"result": {
"nomn": "слово",
"gent": "слова",
"datv": "слову",
"accs": "слово",
"ablt": "словом",
"loct": "слове"
},
"time": 0.000123456
}See updates: https://github.com/mrmuminov/python_russian_cases