<commit_before>from data import anagram_index, warehouse
from spec.mamba import *

with description('anagram_index'):
  with before.all:
    self.subject = anagram_index.AnagramIndex(warehouse.get('/words/unigram'))

  with it('instantiates'):
    expect(len(self.subject)).to(be_above(0))

  with it('accepts pre-sort-jumbled anagrams'):
    expect(self.subject).to(have_key('low'))

  with it('accepts anti-sort-jumbled anagrams'):
    expect(self.subject).to(have_key('wlo'))

  with it('returns multiple matches'):
    expect(self.subject['snap']).to(equal(['snap', 'naps']))<commit_msg>Update anagram index spec data source.<commit_after>import collections

from data import anagram_index
from spec.data.fixtures import tries
from spec.mamba import *

with description('anagram_index'):
  with before.all:
    words = collections.OrderedDict(tries.kitchen_sink_data())
    self.subject = anagram_index.AnagramIndex(words)

  with it('instantiates'):
    expect(len(self.subject)).to(be_above(0))

  with it('accepts pre-sort-jumbled anagrams'):
    expect(self.subject).to(have_key('low'))

  with it('accepts anti-sort-jumbled anagrams'):
    expect(self.subject).to(have_key('wlo'))

  with it('returns multiple matches'):
    expect(self.subject['snap']).to(equal(['snap', 'naps']))
{'fraction_non_alphanumeric': 0.15348837209302327, 'fraction_numerical': 0.0015503875968992248, 'mean_word_length': 5.553299492385787, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1662640', 'n_tokens_mistral': 425, 'n_tokens_neox': 412, 'n_words': 77}