gensim/corpora/hashdictionary.py

Killed 0 out of 9 mutants

Survived

Survived mutation testing. These mutants show holes in your test suite.

Mutant 19

--- gensim/corpora/hashdictionary.py
+++ gensim/corpora/hashdictionary.py
@@ -37,7 +37,7 @@
 from six import iteritems, iterkeys
 
 
-logger = logging.getLogger(__name__)
+logger = None
 
 
 class HashDictionary(utils.SaveLoad, dict):

Mutant 20

--- gensim/corpora/hashdictionary.py
+++ gensim/corpora/hashdictionary.py
@@ -61,7 +61,7 @@
         [(10608, 1), (12466, 1), (31002, 1)]
 
     """
-    def __init__(self, documents=None, id_range=32000, myhash=zlib.adler32, debug=True):
+    def __init__(self, documents=None, id_range=32001, myhash=zlib.adler32, debug=True):
         """
 
         Parameters

Mutant 21

--- gensim/corpora/hashdictionary.py
+++ gensim/corpora/hashdictionary.py
@@ -61,7 +61,7 @@
         [(10608, 1), (12466, 1), (31002, 1)]
 
     """
-    def __init__(self, documents=None, id_range=32000, myhash=zlib.adler32, debug=True):
+    def __init__(self, documents=None, id_range=32000, myhash=zlib.adler32, debug=False):
         """
 
         Parameters

Mutant 22

--- gensim/corpora/hashdictionary.py
+++ gensim/corpora/hashdictionary.py
@@ -151,7 +151,6 @@
     def __str__(self):
         return "HashDictionary(%i id range)" % len(self)
 
-    @staticmethod
     def from_documents(*args, **kwargs):
         return HashDictionary(*args, **kwargs)
 

Mutant 23

--- gensim/corpora/hashdictionary.py
+++ gensim/corpora/hashdictionary.py
@@ -196,7 +196,7 @@
             self, self.num_docs, self.num_pos
         )
 
-    def doc2bow(self, document, allow_update=False, return_missing=False):
+    def doc2bow(self, document, allow_update=True, return_missing=False):
         """Convert a sequence of words `document` into the bag-of-words format of `[(word_id, word_count)]`
         (e.g. `[(1, 4), (150, 1), (2005, 2)]`).
 

Mutant 24

--- gensim/corpora/hashdictionary.py
+++ gensim/corpora/hashdictionary.py
@@ -196,7 +196,7 @@
             self, self.num_docs, self.num_pos
         )
 
-    def doc2bow(self, document, allow_update=False, return_missing=False):
+    def doc2bow(self, document, allow_update=False, return_missing=True):
         """Convert a sequence of words `document` into the bag-of-words format of `[(word_id, word_count)]`
         (e.g. `[(1, 4), (150, 1), (2005, 2)]`).
 

Mutant 25

--- gensim/corpora/hashdictionary.py
+++ gensim/corpora/hashdictionary.py
@@ -262,7 +262,7 @@
         else:
             return result
 
-    def filter_extremes(self, no_below=5, no_above=0.5, keep_n=100000):
+    def filter_extremes(self, no_below=6, no_above=0.5, keep_n=100000):
         """Filter tokens in the debug dictionary by their frequency.
 
         Since :class:`~gensim.corpora.hashdictionary.HashDictionary` id range is fixed and doesn't depend on the number

Mutant 26

--- gensim/corpora/hashdictionary.py
+++ gensim/corpora/hashdictionary.py
@@ -262,7 +262,7 @@
         else:
             return result
 
-    def filter_extremes(self, no_below=5, no_above=0.5, keep_n=100000):
+    def filter_extremes(self, no_below=5, no_above=1.5, keep_n=100000):
         """Filter tokens in the debug dictionary by their frequency.
 
         Since :class:`~gensim.corpora.hashdictionary.HashDictionary` id range is fixed and doesn't depend on the number

Mutant 27

--- gensim/corpora/hashdictionary.py
+++ gensim/corpora/hashdictionary.py
@@ -262,7 +262,7 @@
         else:
             return result
 
-    def filter_extremes(self, no_below=5, no_above=0.5, keep_n=100000):
+    def filter_extremes(self, no_below=5, no_above=0.5, keep_n=100001):
         """Filter tokens in the debug dictionary by their frequency.
 
         Since :class:`~gensim.corpora.hashdictionary.HashDictionary` id range is fixed and doesn't depend on the number