Python nltk.compat.itervalues() Examples

The following are code examples for showing how to use nltk.compat.itervalues(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: razzy-spinner   Author: rafasashi   File: probability.py    GNU General Public License v3.0 5 votes vote down vote up
def N(self):
        """
        Return the total number of sample outcomes that have been
        recorded by this ``ConditionalFreqDist``.

        :rtype: int
        """
        return sum(fdist.N() for fdist in compat.itervalues(self)) 
Example 2
Project: razzy-spinner   Author: rafasashi   File: hole.py    GNU General Public License v3.0 5 votes vote down vote up
def _find_top_nodes(self, node_list):
        top_nodes = node_list.copy()
        for f in compat.itervalues(self.fragments):
            # the label is the first argument of the predicate
            args = f[1]
            for arg in args:
                if arg in node_list:
                    top_nodes.discard(arg)
        return top_nodes 
Example 3
Project: OpenBottle   Author: xiaozhuchacha   File: probability.py    MIT License 5 votes vote down vote up
def N(self):
        """
        Return the total number of sample outcomes that have been
        recorded by this ``ConditionalFreqDist``.

        :rtype: int
        """
        return sum(fdist.N() for fdist in compat.itervalues(self)) 
Example 4
Project: OpenBottle   Author: xiaozhuchacha   File: hole.py    MIT License 5 votes vote down vote up
def _find_top_nodes(self, node_list):
        top_nodes = node_list.copy()
        for f in compat.itervalues(self.fragments):
            # the label is the first argument of the predicate
            args = f[1]
            for arg in args:
                if arg in node_list:
                    top_nodes.discard(arg)
        return top_nodes 
Example 5
Project: OpenBottle   Author: xiaozhuchacha   File: probability.py    MIT License 5 votes vote down vote up
def N(self):
        """
        Return the total number of sample outcomes that have been
        recorded by this ``ConditionalFreqDist``.

        :rtype: int
        """
        return sum(fdist.N() for fdist in compat.itervalues(self)) 
Example 6
Project: OpenBottle   Author: xiaozhuchacha   File: hole.py    MIT License 5 votes vote down vote up
def _find_top_nodes(self, node_list):
        top_nodes = node_list.copy()
        for f in compat.itervalues(self.fragments):
            # the label is the first argument of the predicate
            args = f[1]
            for arg in args:
                if arg in node_list:
                    top_nodes.discard(arg)
        return top_nodes 
Example 7
Project: FancyWord   Author: EastonLee   File: probability.py    GNU General Public License v3.0 5 votes vote down vote up
def N(self):
        """
        Return the total number of sample outcomes that have been
        recorded by this ``ConditionalFreqDist``.

        :rtype: int
        """
        return sum(fdist.N() for fdist in compat.itervalues(self)) 
Example 8
Project: FancyWord   Author: EastonLee   File: hole.py    GNU General Public License v3.0 5 votes vote down vote up
def _find_top_nodes(self, node_list):
        top_nodes = node_list.copy()
        for f in compat.itervalues(self.fragments):
            # the label is the first argument of the predicate
            args = f[1]
            for arg in args:
                if arg in node_list:
                    top_nodes.discard(arg)
        return top_nodes 
Example 9
Project: honours_project   Author: JFriel   File: probability.py    GNU General Public License v3.0 5 votes vote down vote up
def N(self):
        """
        Return the total number of sample outcomes that have been
        recorded by this ``ConditionalFreqDist``.

        :rtype: int
        """
        return sum(fdist.N() for fdist in compat.itervalues(self)) 
Example 10
Project: honours_project   Author: JFriel   File: hole.py    GNU General Public License v3.0 5 votes vote down vote up
def _find_top_nodes(self, node_list):
        top_nodes = node_list.copy()
        for f in compat.itervalues(self.fragments):
            # the label is the first argument of the predicate
            args = f[1]
            for arg in args:
                if arg in node_list:
                    top_nodes.discard(arg)
        return top_nodes 
Example 11
Project: honours_project   Author: JFriel   File: probability.py    GNU General Public License v3.0 5 votes vote down vote up
def N(self):
        """
        Return the total number of sample outcomes that have been
        recorded by this ``ConditionalFreqDist``.

        :rtype: int
        """
        return sum(fdist.N() for fdist in compat.itervalues(self)) 
Example 12
Project: honours_project   Author: JFriel   File: hole.py    GNU General Public License v3.0 5 votes vote down vote up
def _find_top_nodes(self, node_list):
        top_nodes = node_list.copy()
        for f in compat.itervalues(self.fragments):
            # the label is the first argument of the predicate
            args = f[1]
            for arg in args:
                if arg in node_list:
                    top_nodes.discard(arg)
        return top_nodes 
Example 13
Project: serverless-chatbots-workshop   Author: datteswararao   File: probability.py    Apache License 2.0 5 votes vote down vote up
def N(self):
        """
        Return the total number of sample outcomes that have been
        recorded by this ``ConditionalFreqDist``.

        :rtype: int
        """
        return sum(fdist.N() for fdist in compat.itervalues(self)) 
Example 14
Project: serverless-chatbots-workshop   Author: datteswararao   File: hole.py    Apache License 2.0 5 votes vote down vote up
def _find_top_nodes(self, node_list):
        top_nodes = node_list.copy()
        for f in compat.itervalues(self.fragments):
            # the label is the first argument of the predicate
            args = f[1]
            for arg in args:
                if arg in node_list:
                    top_nodes.discard(arg)
        return top_nodes 
Example 15
Project: serverless-chatbots-workshop   Author: datteswararao   File: probability.py    Apache License 2.0 5 votes vote down vote up
def N(self):
        """
        Return the total number of sample outcomes that have been
        recorded by this ``ConditionalFreqDist``.

        :rtype: int
        """
        return sum(fdist.N() for fdist in compat.itervalues(self)) 
Example 16
Project: serverless-chatbots-workshop   Author: datteswararao   File: hole.py    Apache License 2.0 5 votes vote down vote up
def _find_top_nodes(self, node_list):
        top_nodes = node_list.copy()
        for f in compat.itervalues(self.fragments):
            # the label is the first argument of the predicate
            args = f[1]
            for arg in args:
                if arg in node_list:
                    top_nodes.discard(arg)
        return top_nodes