I have been trying to create an application where we can find patterns in a file(txt). I do know how to get the pattern by giving specific words and finding out how many times that word has been repeated. What I am trying to get is patterns which are not specific, more like finding a pattern without an input of words for searching.
For example
- John is working at home and [is using a] mac. [He stays in] Chicago.
- The customer [is using a] phone for ordering groceries. [He stays in] India.
- [He stays in] LA, who [is using a] Fake account to access a website.
Here when I get the above lines in a file I am not aware of what is present in the file and what I have to search but I want to get the reputative patterns which are "is using a" and "He stays in" as output.
Apologies if I am not clear with my explanation. It will be of great help if someone could help me. Thanks in Advance.