Hello, I require a simple script, written preferably in PHP, which which inputs a csv file, the first column of which contains short paragraphs of text. The script will search for a particular exact match keyword phrase (which I will specify through some sort of control panel) and will extract the sentence containing that keyphrase and the sentence after that keyphrase, and delete the rest of the text, so, for example: if i enter the keyphrase "florida 1987" in the control panel, and the csv i upload contains the following text.
"Hotel building in florida is on the rise. This has been the case for many years. In Florida 1987 was the peak year for hotel construction. This trend continues to this day"
The script would leave "This has been the case for many years. In Florida 1987 was the peak year for hotel construction" in that same cell and delete all other text that was in that cell.
This csv could then be downloaded.
I would like the script to be able to recognise any sentences that begin or end with "." "!" or "?", and also to recognise that sometimes people end sentences with multiple punctuation marks i.e. "!!!" "???" "..."
The keyphrase could be anything from 1 word to 6 or 7 words and will always be exact match.