I've been playing around a bit and googling all over for this, but I can't find a good solution.
It's for a search function.
I highlight the keywords found in the text (wrapped in <b> tags), which I have done.
Now I want to pick out those sentences where those highlighted words belong. Pretty much like google does it when you see your search results.
Example:
The text:
"My name is Kurt, I come from New Jersey in India where I work as a baby-stylist.I'm eighty-four years old and I live with my grandmother. I have three cats and forty-four snakes."
I search for : [ New snakes ]. My function will highlight the words:
"My name is Kurt, I come from New Jersey in India where I work as a baby-stylist.I'm eighty-four years old and I live with my grandmother. I have three cats and forty-four snakes."
Now I want to extract the sentences where the keywords are (unless the sentences are too long).
"My name is Kurt, I come from New Jersey in India where I work ... I have three cats and forty-four snakes."
Bookmarks