yield all node IDs that dominate the given phrase type, e.g. all NPs

def get_phrases(self, ns=None, layer='syntax', cat_key='cat', cat_val='NP'):
        """yield all node IDs that dominate the given phrase type, e.g. all NPs"""
        if not ns:
            ns = self.ns

        for node_id in select_nodes_by_layer(self, '{0}:{1}'.format(ns, layer)):
            if self.node[node_id][self.ns+':'+cat_key] == cat_val:
                yield node_id