my question is how am I supposed to recognize a singular form of a noun which plural form ends with "ies"? As you can see "cookies" are a "cookie" when singular, but at the same time "flies" stand for a "fly". It seems there's no rule for this, so I am rather asking for a list of exceptions if you will. Thank you.
It turns out that you don't need to worry too much: it's something in the order of 100 times more likely that the base word ends in -y.
Common exceptions are:
- a few common monosyllabic words ("die", "lie", "tie", "pie") and compounds ("untie", "underlie"...);
- a few loanwords from French ("sortie", "crêperie", "cameraderie"...) plus one or two older loans that are now fairly well integrated (notably "calorie")
- a few informal words, which can actually often be spelt either way ("hippy/hippie", "sweety/sweetie", "movie", "druggy/druggie"...)
- the odd other word ("eerie", "zombie")
Overall, no need to lose too much sleep.
The correct and practicable solution to your problem can only be a database lookup. No single algorithm will work, however complex it may be.
Have all the words, each with its corresponding plural forms (there will be more than one in some cases) in a db table. Index it on the plurals. Easier than it appears to be.
There will just be one hitch, still. What if two different words have the same plural form? I leave that as a separate exercise (that is to say "I don't know").