Answer the question
In order to leave comments, you need to log in
Base of cities in the right case?
I would like something strange, namely, to write on the site “in Moscow”, “in St. Petersburg”, etc. depending on the city of the user visiting the site.
Maybe there is somewhere a database of Russian cities in different cases? Or maybe someone has?
Answer the question
In order to leave comments, you need to log in
This is how you can still cling to the edge on the fly, well, or write a script, download the necessary ones:
export.yandex.ru/inflect.xml?name=%D0%91%D0%B0%D1%80%D0%BD%D0%B0 %D1%83%D0%BB
Isn't it easier to script the simple rules of the Russian language?
For example, like this:
1) Moscow a => Moscow e
2) Petrburg g => Petrburg So
, offhand, if the name ends in a vowel or a soft sign, we change it to the letter e.
There is a morphological library for PHP, phpmorphy, I don't remember. Accordingly, through it, you can put the city in the desired case.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question