Answer the question
In order to leave comments, you need to log in
How to programmatically find out which letter of a word is stressed?
Suppose that the site has a form in which anyone can enter a word and find out which letter of this word is stressed. How to programmatically find out where the emphasis falls, for example, on php?
Perhaps you need to create a database with several dozen tables that will contain the entire spelling dictionary with accents. But what about word forms? The database will contain the word "cat", and the user will enter the word "cats" and this word will not be in the database. It turns out that the word must somehow be broken into parts, analyzed, etc. I don't even know which direction to go in.
Is it advisable to do this in php at all?
Answer the question
In order to leave comments, you need to log in
1. Whether it is expedient on PHP - yes.
2. No word - breakdown into a "tree" of trigrams.
3. Stresses - only a complex analysis: through a dictionary with a base of stresses in different word forms (number, case, gender, etc.) and through a trained neuron on "chains" of words (semantic contextual validation).
This is a very difficult task, even if you have a database of word stresses.Имеешь права не имеешь права
But what about word forms?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question