Skip to content

Commit

Permalink
Merge pull request #10 from microprediction/filter-animals
Browse files Browse the repository at this point in the history
Filter the list of animals to hex
  • Loading branch information
microprediction authored Jul 23, 2020
2 parents cb01d31 + 55b5e4b commit 9df0c01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion offline/animals.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion offline/prepare_corpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def corpus_len_k1_k2(k1, k2, readable=False, separator='', capitalize=False):
if readable:
return [capitalize_maybe(word=w1, capitalize=capitalize) + separator + capitalize_maybe(word=w2, capitalize=capitalize)for w1 in first_words for w2 in animals_k2]
else:
hex_animals = [from_readable_hex(a) for a in animals_of_len(k2)]
hex_animals = [from_readable_hex(a) for a in animals_of_len(k2) if all(c in valid_chars for c in a)]
hex_first_words = [from_readable_hex(w) for w in first_words]
hex_corpus = [w1 + separator + w2 for w1 in hex_first_words for w2 in hex_animals]
return hex_corpus
Expand Down

0 comments on commit 9df0c01

Please # to comment.