<commit_before># Chapter 17 Practice Questions

# 1. What is the word pattern for the word hello?
import books.CrackingCodesWithPython.Chapter17.makeWordPatterns

wordPat = books.CrackingCodesWithPython.Chapter17.makeWordPatterns.getWordPattern('hello')
print(wordPat)

# 2. Do mammoth and goggles have the same word pattern?
wordPat1 = books.CrackingCodesWithPython.Chapter17.makeWordPatterns.getWordPattern('mammoth')
wordPat2 = books.CrackingCodesWithPython.Chapter17.makeWordPatterns.getWordPattern('goggles')

if wordPat1 == wordPat2:
    print("Yes: " + wordPat1)
else:
    print("No: " + wordPat1 + " and " + wordPat2)

# 3. Which word could be the possible plaintext word for the cipherword
#    PYYACAO? Alleged, efficiently, or poodle?
wordPat = []
words = ["PYYACAO", "Alleged", "efficiently", "poodle"]
for word in words:
    wordPat.append(books.CrackingCodesWithPython.Chapter17.makeWordPatterns.getWordPattern(word))

for index in range(1, len(wordPat)):
    if wordPat[0] == wordPat[index]:
        print("It's gotta be %s!" % words[index])
        break
    elif index == len(wordPat) - 1:
        print("Match not found (-_-)")<commit_msg>Update Ch. 17 PracticeQuestions: imported specific function<commit_after># Chapter 17 Practice Questions

# 1. What is the word pattern for the word hello?
from books.CrackingCodesWithPython.Chapter17.makeWordPatterns import getWordPattern

wordPat = getWordPattern('hello')
print(wordPat)

# 2. Do mammoth and goggles have the same word pattern?
wordPat1 = getWordPattern('mammoth')
wordPat2 = getWordPattern('goggles')

if wordPat1 == wordPat2:
    print("Yes: " + wordPat1)
else:
    print("No: " + wordPat1 + " and " + wordPat2)

# 3. Which word could be the possible plaintext word for the cipherword
#    PYYACAO? Alleged, efficiently, or poodle?
wordPat = []
words = ["PYYACAO", "Alleged", "efficiently", "poodle"]
for word in words:
    wordPat.append(getWordPattern(word))

for index in range(1, len(wordPat)):
    if wordPat[0] == wordPat[index]:
        print("It's gotta be %s!" % words[index])
        break
    elif index == len(wordPat) - 1:
        print("Match not found (-_-)")
{'fraction_non_alphanumeric': 0.1171003717472119, 'fraction_numerical': 0.020446096654275093, 'mean_word_length': 4.606770833333333, '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': '3520502', 'n_tokens_mistral': 735, 'n_tokens_neox': 695, 'n_words': 196}