I
I
Igor Vasiliev2016-08-03 14:22:04
Yii
Igor Vasiliev, 2016-08-03 14:22:04

Declension of rare names on Yii2 Advanced, how to solve a non-standard situation?

I learned about the php script "NCL.NameCase", which declines names by cases. Everything works perfectly, if the situation is standard.
Namely, we are talking about names that are often found, which any person will determine by ear whether these are female or male names, and they can decline correctly by cases. But there are rare names that rarely come across anywhere, especially in Russia. For example, such as: Aiger, Chulpan - these are female names! But this is not immediately clear, because female names often end in a vowel, but here the names end in consonants, which gives the impression that these are male names.
As an output, I see only a function that will contain an array of names (including those that are not inflected), which in turn will be recognized by the script. Advise how to make competently (without crutches), this feature on Yii2.
Here is the repository on GitHub https://github.com/Vaigmi/Declination

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
mletov, 2016-08-03
@mletov

There is no such universal algorithm that will correctly decline any name. And only fairly large companies like VK have quite complete databases with declensions of all world names, they are unlikely to share.
Keep a table with declensions of rare names in the database. There are a lot of scripts that correctly incline Ivanov, Petrov and Sidorov, but there will always be some Tumba-Yumba who is inclined incorrectly. If the project is as serious as you say, then there will probably be enough money to keep a person at the rate who will receive complaints and enter declensions through the interface.

T
ThunderCat, 2016-08-03
@ThunderCat

As an option - immediately make a small questionnaire after registration - a page with fields filled in with the name in different cases (with a piece of text like "I'm crazy about [Chulpan]"), and ask the user to check the correctness of the declension. The corrections can be saved in the database and used in the future.

M
Maxim Timofeev, 2016-08-03
@webinar

(including non-inflected cases)

why? not in the array, so no need to incline

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question