Skip to content

Instantly share code, notes, and snippets.

@apage43
Created May 13, 2017 07:24
Show Gist options
  • Save apage43/51232daa90f1582d701c79536b6d919c to your computer and use it in GitHub Desktop.
Save apage43/51232daa90f1582d701c79536b6d919c to your computer and use it in GitHub Desktop.
In [1]: from pathlib import Path
In [2]: from codecs import encode
In [3]: words = set(Path('/usr/share/dict/words').read_text().splitlines())
In [4]: rot13 = set(encode(w, 'rot13') for w in words)
In [5]: [(w, encode(w, 'rot13')) for w in (words & rot13) if len(w) >= 3]
Out[5]:
[('dhoon', 'qubba'),
('rail', 'envy'),
('bor', 'obe'),
('fun', 'sha'),
('gurr', 'thee'),
('nep', 'arc'),
('turr', 'ghee'),
('chee', 'purr'),
('fur', 'she'),
('envy', 'rail'),
('Iraq', 'Vend'),
('tung', 'ghat'),
('ban', 'ona'),
('anan', 'nana'),
('Ana', 'Nan'),
('ort', 'beg'),
('cheer', 'purre'),
('ben', 'ora'),
('vat', 'ing'),
('purrel', 'cheery'),
('urea', 'hern'),
('beg', 'ort'),
('ghat', 'tung'),
('pub', 'cho'),
('whar', 'june'),
('oho', 'bub'),
('sen', 'fra'),
('tee', 'grr'),
('Onan', 'Bana'),
('flap', 'sync'),
('pung', 'chat'),
('ora', 'ben'),
('nub', 'aho'),
('bar', 'one'),
('pun', 'cha'),
('terral', 'greeny'),
('gers', 'tref'),
('birl', 'ovey'),
('cho', 'pub'),
('shag', 'funt'),
('aha', 'nun'),
('err', 'ree'),
('Ghan', 'Tuna'),
('ree', 'err'),
('avo', 'nib'),
('naa', 'ann'),
('sho', 'fub'),
('trah', 'genu'),
('Ban', 'Ona'),
('guna', 'than'),
('Tuna', 'Ghan'),
('Nan', 'Ana'),
('ure', 'her'),
('ovey', 'birl'),
('june', 'whar'),
('arn', 'nea'),
('gul', 'thy'),
('bel', 'ory'),
('Bana', 'Onan'),
('than', 'guna'),
('Ona', 'Ban'),
('erne', 'rear'),
('ref', 'ers'),
('shool', 'fubby'),
('rear', 'erne'),
('nib', 'avo'),
('purre', 'cheer'),
('vex', 'irk'),
('balk', 'onyx'),
('neon', 'arba'),
('arc', 'nep'),
('genu', 'trah'),
('perry', 'creel'),
('hern', 'urea'),
('gent', 'trag'),
('bes', 'orf'),
('chat', 'pung'),
('fra', 'sen'),
('gurl', 'they'),
('tref', 'gers'),
('funt', 'shag'),
('nana', 'anan'),
('one', 'bar'),
('tane', 'gnar'),
('gur', 'the'),
('fubby', 'shool'),
('ory', 'bel'),
('uva', 'hin'),
('gel', 'try'),
('Vend', 'Iraq'),
('hen', 'ura'),
('ten', 'gra'),
('pent', 'crag'),
('ret', 'erg'),
('the', 'gur'),
('gra', 'ten'),
('gnat', 'tang'),
('aho', 'nub'),
('tha', 'gun'),
('ura', 'hen'),
('navy', 'anil'),
('clerk', 'pyrex'),
('sneb', 'faro'),
('grr', 'tee'),
('ant', 'nag'),
('ona', 'ban'),
('irk', 'vex'),
('pur', 'che'),
('onyx', 'balk'),
('chal', 'puny'),
('nowhere', 'abjurer'),
('teng', 'grat'),
('bin', 'ova'),
('becuna', 'orphan'),
('anil', 'navy'),
('non', 'aba'),
('abjurer', 'nowhere'),
('gun', 'tha'),
('obe', 'bor'),
('serve', 'freir'),
('tra', 'gen'),
('ana', 'nan'),
('erg', 'ret'),
('qubba', 'dhoon'),
('hin', 'uva'),
('ore', 'ber'),
('orf', 'bes'),
('pyrex', 'clerk'),
('gen', 'tra'),
('they', 'gurl'),
('ber', 'ore'),
('crea', 'pern'),
('viva', 'ivin'),
('nan', 'ana'),
('try', 'gel'),
('nun', 'aha'),
('thee', 'gurr'),
('sync', 'flap'),
('aba', 'non'),
('her', 'ure'),
('thaw', 'gunj'),
('ing', 'vat'),
('tang', 'gnat'),
('freir', 'serve'),
('che', 'pur'),
('cha', 'pun'),
('ers', 'ref'),
('ova', 'bin'),
('fant', 'snag'),
('ivin', 'viva'),
('gunj', 'thaw'),
('arba', 'neon'),
('ann', 'naa'),
('oner', 'bare'),
('trag', 'gent'),
('she', 'fur'),
('bare', 'oner'),
('greeny', 'terral'),
('cheery', 'purrel'),
('bean', 'orna'),
('nea', 'arn'),
('gnar', 'tane'),
('grat', 'teng'),
('nag', 'ant'),
('sha', 'fun'),
('pho', 'cub'),
('orphan', 'becuna'),
('puny', 'chal'),
('crag', 'pent'),
('fub', 'sho'),
('bub', 'oho'),
('thy', 'gul'),
('purr', 'chee'),
('orna', 'bean'),
('snag', 'fant'),
('cub', 'pho'),
('creel', 'perry'),
('ghee', 'turr'),
('faro', 'sneb'),
('pern', 'crea')]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment