I
I
IvanIF2019-12-29 03:02:10
PHP
IvanIF, 2019-12-29 03:02:10

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

5 answer(s)
X
xmoonlight, 2019-12-29
@IvanIF

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).

B
bkosun, 2019-12-29
@bkosun

This is a very difficult task, even if you have a database of word stresses.
Имеешь права не имеешь права

K
Konstantin Tsvetkov, 2019-12-29
@tsklab

Programmatically , and then parse.

A
Alexey Sundukov, 2020-12-30
@alekciy

But what about word forms?

phpMorphy helps a lot .
The specified example is about " cats ".

S
SOTVM, 2019-12-29
@sotvm

only a dictionary + enumeration
of other options / algorithms no

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question