Hello,
I would like extract a part of a sentence around a key word.
For example:
Input:
1. John wants to buy 5 apples today in the market.
2. There are three apples in the fruit bowl.
3. The red apples fell from the tree.
Output:
1. buy 5 apples today in
2. are three apples in the
3. The red apple fell from
Sometimes there could be a number before the term apple or a full word, but ideally I would like to extract 2 either words or numbers (a number with multiple digits should cound as one number) and 2 words after and of course include the word apples.
Thanks in advance,
Joseph