Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class String
- @@words = File.open("dictionary").read.split
- def self.words
- @@words
- end
- def is_word?
- @@words.include? self
- end
- def qwerty_to_colemak
- self.downcase.tr("qwertyuiopasdfghjkl;zxcvbnm", "qwfpgjluy;arstdhneiozxcvbkm")
- end
- def qwerty_to_dvorak
- self.downcase.tr("qwertyuiopasdfghjkl;zxcvbnm,./", "',.pyfgcrlaoeuidhtns;qjkxbmwvz")
- end
- end
- String.words.each do |word|
- next if word.length < 5
- colemak_word = word.qwerty_to_colemak
- p [word, colemak_word] if colemak_word.is_word?
- end
Add Comment
Please, Sign In to add comment