M
M
Msim2015-05-15 10:44:45
JSON
Msim, 2015-05-15 10:44:45

How to split a title into subtitles?

For example, the name of the product is 'Nuts bar with nuts', you need to overtake a nut bar, a bar with nuts, etc. in json. Are there any ready-made solutions or write from scratch? about 30,000 goods
Well, let's unload the goods via csv, take only the names, throw them into a file or array and split them into json

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
myfirepukan, 2015-05-15
@Msim

This is a very difficult task, it can only be solved if certain rules are observed.
If the keyword is always the first one, then you can split the explode on a space, clear it of prepositions, and then append each word to the 0 element of the array, but there will be a "bar of nuts" preposition, then you will lose it. And the preposition can be saved by attaching the next element of the array to it. But if there is a phrase "A girl ate a bar with her mother", then one of the options will be "A bar with her mother" :))))

B
bromzh, 2015-05-15
@bromzh

Yandex had a text recognition project somewhere. Try to screw it. In general, this is a very difficult task, especially for the Russian language and an arbitrary description format.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question