I would like to combine with a linux command, if possible, all the words that start with a capital letter, excluding the one at the beginning of the line. The goal is to create edges between these words. For example:
My friend John met Beatrice and Lucio.
The result I would like to have should be:
- John, Beatrice
- John, Lucio
- Beatrice, Lucio
I managed to get all the words that start with a capital letter, excluding the word at the beginning of the line through a regex. The regex is:
*cat gov.json | grep -oP "\b([A-Z][a-z']*)(\s[A-Z][a-z']*)*\b | ^(\s*.*?\s).*" > nodes.csv*
The nodes managed to enter them individually in column, ie:
- John
- Beatrice
- Lucio
The goal now is to create the possible combinations between names that start with a capital letter and put them into a file. Any suggestions?
