nltk/nltk — Issue #196: FeatStruct.reentrances() returns a list of id's
Author: heatherleaf
Created: 2012-02-01 09:24:03+00:00
State: open

According to the documentation, FeatStruct.reentrances() should return a list of FeatStruct:

Return a list of all feature structures that can be reached
from ``self`` by multiple feature paths.
:rtype: list(FeatStruct)

However, it returns a list of object id's, which makes the method practically useless. To make it return FeatStruct's, I think ._find_reentrances() need to store the object itself in the reentrances dict. This affects the following FeatStruct methods: .cyclic(), .reentrances(), ._repr() and ._str()

Alternatively, we can change the method doc, but as I said, the method becomes quite useless.

A third possibility is to return the feature paths themselves. But that's more difficult to implement I guess.