/// <summary> /// Gets whether or not this node has a given feature /// </summary> /// <param name="feature">Feature to check for</param> /// <returns>True if node has feature, false otherwise</returns> public bool HasFeature(NomBankNodeLabel.NodeFeature feature) { foreach (NomBankNodeLabel label in _labels) { if (label.Feature == feature) { return(true); } } return(false); }
/// <summary> /// Gets descendant nodes by their feature /// </summary> /// <param name="feature">Feature of nodes to get</param> /// <returns>Nodes with given feature</returns> public List <NomBankNode> GetDescendants(NomBankNodeLabel.NodeFeature feature) { List <NomBankNode> nodes = new List <NomBankNode>(); foreach (NomBankNode n in Descendants) { if (n.HasFeature(feature)) { nodes.Add(n); } } return(nodes); }