Created
October 10, 2014 08:23
-
-
Save josephg/01283b54847fa5053d87 to your computer and use it in GitHub Desktop.
Cool words - http://www.reddit.com/r/Showerthoughts/comments/2irpuq/eclipse_is_probably_the_longest_word_in_the/
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
# Get your word list: | |
# curl 'http://www-01.sil.org/linguistics/wordlists/english/wordlist/wordsEn.txt' -O | |
fs = require 'fs' | |
words = for word in fs.readFileSync('wordsEn.txt', 'utf8').split '\n' when word != '' | |
if word[word.length - 1] is '\r' | |
word[...word.length - 1] | |
else | |
word | |
#console.log words.length | |
w = {} | |
w[word] = true for word in words | |
w['i'] = true # Missing for some reason. | |
longest = '' | |
for word in words | |
w2 = word | |
cool = true | |
while word.length > 0 and cool | |
cool = false unless w[word] | |
word = word[1...word.length - 1] | |
if cool | |
if w2.length > longest.length | |
longest = w2 | |
console.log w2 if w2.length >= 7 | |
console.log 'longest', longest | |
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
8 letter words: | |
balinese | |
blessers | |
braiders | |
dopiness | |
drabbets | |
gaminess | |
lashings | |
methanes | |
pleasers | |
relaters | |
ropiness | |
washings | |
7 letter words: | |
ashamed | |
ashiest | |
borated | |
borates | |
bovines | |
bowings | |
busings | |
dosages | |
eclipse | |
escaped | |
escapee | |
escaper | |
escapes | |
estated | |
estates | |
flyings | |
lawings | |
lowings | |
musings | |
pirated | |
pirates | |
prearms | |
rowings | |
salient | |
scraped | |
scraper | |
scrapes | |
scrawls | |
scrawly | |
scrimps | |
scrimpy | |
sewings | |
sheathe | |
sheaths | |
striped | |
striper | |
stripes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment