Answer the question
In order to leave comments, you need to log in
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
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" :))))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question