class CryptogramSolver

Defined in:

cryptogram.cr
cryptogram_byte.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(file_path) #

[View source]

Instance Method Detail

def build_indices #

[View source]
def find_candidate_word_matches(encrypted_word, letter_mapping : Hash(Char, Char)) : Set(String) #

[View source]
def find_candidate_word_matches(encrypted_word, letter_mapping : Hash(UInt8, UInt8)) : Set(String) #

[View source]
def find_words_by_letter_and_position(letter, letter_index_position) #

[View source]
def find_words_by_pattern(word_pattern) #

[View source]
def guess(letter_mapping, reverse_letter_mapping, encrypted_words) : Array(Hash(UInt8, UInt8)) #

[View source]
def solve(phrase) #

[View source]
def try_extend_mapping(word, encrypted_word, letter_mapping, reverse_letter_mapping) : Tuple(Hash(UInt8, UInt8), Hash(UInt8, UInt8)) | Nil #

if word is a possible match for the encrypted_word, given the existing letter_mapping, then this function returns the combined letter mappings of the word-specific letter mappings and the existing letter mappings; nil otherwise Assumes word.size == encrypted_word.size


[View source]
def word_pattern(word) #

[View source]