def test_letters_count_none(): drop_caches() with settings.file_override("TOKENS"): with open(settings.TOKENS, "wb") as f: pickle.dump({"these", "are", "tokens"}, f) assert SubstitutionFeaturesMixin._letters_count() == {"these", "are", "tokens"}
def test_letters_count_none_with_computed(): drop_caches() # Lemmas are all lowercase. for word in SubstitutionFeaturesMixin._letters_count(): assert word.islower() or is_int(word[0]) or is_int(word[-1])
def test_letters_count(): drop_caches() assert SubstitutionFeaturesMixin._letters_count("hello") == 5 assert SubstitutionFeaturesMixin._letters_count("mountain") == 8 assert SubstitutionFeaturesMixin._letters_count("makakiki") == 8