예제 #1
0
    def test_list_score(self):
        """
        Test that weighting a list returns the weights of the documents.
        """

        tokens = ['a', 'b']
        scheme = Filler()
        self.assertEqual({'a': 1, 'b': 1}, scheme.score(tokens))
예제 #2
0
    def test_repeated_score(self):
        """
        Test that weighting a list with repeated features returns boolean weights.
        """

        tokens = ['a', 'b', 'a']
        scheme = Filler()
        self.assertEqual({'a': 1, 'b': 1}, scheme.score(tokens))
예제 #3
0
    def test_empty_list_score(self):
        """
        Test that weighting an empty list returns no weights.
        """

        tokens = []
        scheme = Filler()
        self.assertEqual({}, scheme.score(tokens))