Skip to content

Commit

Permalink
Fixed bug caused by hash_seeds call before self.method defined
Browse files Browse the repository at this point in the history
  • Loading branch information
justinbt1 committed Apr 24, 2022
1 parent 7fd36d2 commit 24962ff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions akin/minhash.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def __init__(
"""
self.n_gram = n_gram

if n_gram_type not in ['char', 'term']:
raise ValueError(
'Only "char" and "term" n_gram types are supported.'
Expand All @@ -61,8 +62,6 @@ def __init__(
self.seed = seed
np.random.seed(seed)

self._hash_seeds = self._generate_random_seeds()

if method not in [
'multi_hash',
'k_smallest_values'
Expand All @@ -72,6 +71,8 @@ def __init__(
)
self.method = method

self._hash_seeds = self._generate_random_seeds()

# Run methods.
self._shingles = self._k_shingles(text)
self.signatures = self._min_hash()
Expand Down

0 comments on commit 24962ff

Please sign in to comment.