예제 #1
0
        /// <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);
        }
예제 #2
0
        /// <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);
        }