Find words which contain the most consonants: Difference between revisions

(→‎{{header|Haskell}}: Added a 'no consonant used twice' variant of the test)
Line 1,857:
347 most consonant words: {{9,"comprehensible"},{8,"administrable"},"...",{4,"bourgeoisie"},{4,"onomatopoeia"}}
</pre>
 
=={{header|Python}}==
"Use Python," they say, "it's comprehensible," they say.
<lang python>import re
 
print('\n'.join(map(lambda x: f'{x[0]}: {" ".join(sorted(x[1]))}' if len(x[1]) < 50 else f'{x[0]}: {len(x[1])} words', (filter(lambda x: x[1], ((n, (lambda n, l=sorted(((len(c), w) for w in (l.rstrip() for l in open('unixdict.txt') if re.match(r'^[a-z]+$', l)) if (c := list(sorted(re.sub(r'[aeiou]', '', w)))) == list(sorted(set(c)))), reverse=True): [w for c,w in l if c == n])(n)) for n in range(20, -1, -1)))))))</lang>
{{out}}
<pre>9: comprehensible
8: administrable anthropology bankruptcy ...<40 some odd words>... thunderclap
7: 293 words
6: 1141 words
5: 2717 words
4: 4310 words
3: 3964 words
2: 1956 words
1: 277 words
0: a aaa aau e i ia ieee ii iii io o u</pre>
 
=={{header|R}}==