Created
February 27, 2014 18:18
-
-
Save sirpengi/9255688 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
with open("/usr/share/dict/words") as fh: | |
solutions = {} | |
for i, line in enumerate(fh.readlines()): | |
if i > 100000: | |
break | |
w = line.lower().strip() | |
h = tuple(sorted(Counter(w).elements())) | |
if h not in solutions: | |
solutions[h] = set() | |
solutions[h].add(w) | |
for k, v in solutions.iteritems(): | |
if len(v) > 1: | |
print ",".join(v) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blighted,bedlight | |
algine,angeli | |
blesse,bessel | |
betassel,beatless | |
berman,barmen | |
brick,birck | |
adze,daze | |
borated,aborted | |
ascus,casus | |
coloner,coronel,celoron | |
balbo,babol | |
condos,codons | |
carapine,carpaine | |
bearfoot,barefoot | |
collegian,allogenic | |
casimeres,cassimere | |
cerimans,cremains,carmines | |
carryout,curatory | |
albee,abele,beale | |
deasil,aisled | |
carbonaro,barracoon | |
butled,budlet | |
bushbuck,buckbush | |
brephic,bechirp | |
cva,acv,cav,avc | |
chilean,chinela | |
basia,asabi | |
calahan,chalana | |
aftercast,artefacts | |
bearcats,abreacts,cabresta,cabarets | |
bto,bot | |
cerebrums,cumberers | |
cutigeral,curtilage | |
aristate,ariettas | |
coempt,compte | |
bfa,afb | |
acs,asc,cas,csa | |
blade,abdel,baled,belda | |
abdul,bauld | |
coryat,actory | |
.... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment