I\'m reading in a long list of words, and I made a node for every word in the list. Each node has an attribute \'word\' for their position in the list.
Looks like a formal languages problem. How do you handle looping nodes?
IN INW is in the list you gave.
AGNRT AGNRST are not in the list, because you started out with a single letter, that letter has to be in the next word for example I -> IN, but IN is not in AGNRT or AGNRST