Wednesday, November 24, 2010

B E g h I L O S. A list of ALL of them.

One of the most momentous days of my life came during a boring lecture in math class as a seventh grader. Daydreaming off into the distance, my neighbor quickly tossed me his calculator, turned it upside down, and told me to read it. He had typed the letters 0.7734, which looked like 'h.ELLO'.

I have never been bored since that day.

At work this last week, I was programming an application that only keypad for user input. To display a report on the monitor, I decided to require the user to type 0.7734. It was either that or 8675309. I don't know if anyone will ever figure out the significance of the number or not.

Today, my user asked for a new report. This requires me to come up with a new numeric sequence, leading me to research calculator spelling. The official name for calculator spelling is called a BEghILOS (those are the letters that resemble numbers on the calculator).

I have been wanting to write something in python (the programming language) for some time now and decided that this project was as good as any. So I wrote a program listing all the possible BEghiLOS that exist. It turns out there are 542 of them.

The dictionary I used was found here. If you know of a BEghILOS that is not on the list, its the fault of the dictionary :) Please add it in the comments.

I also posted the python script after the below list. Any of you python gurus out there, if you see anything weird with my code, please let me know. It's my first python program, so I'd be surprised if there wasn't something wrong.

WordCalculator Numbers
be38
bee338
beebee338338
beebees5338338
bees5338
beg938
begs5938
beige39138
beiges539138
bel738
belie31738
belies531738
bell7738
belle37738
belles537738
bellies5317738
bells57738
bels5738
besiege3931538
besieges53931538
bezel73238
bezels573238
bezil71238
bezils571238
bi18
bib818
bibb8818
bibbs58818
bible37818
bibles537818
bibless5537818
bibs5818
big918
biggie319918
biggies5319918
biggish4519918
bigs5918
bilbo08718
bilboes5308718
bilbos508718
bile3718
biles53718
bilge39718
bilges539718
bill7718
billie317718
billies5317718
bills57718
bio018
bios5018
bis518
bise3518
bises53518
biz218
bize3218
bizes53218
bizzes532218
bleb8378
blebs58378
bless55378
blesses5355378
bliss55178
blisses5355178
blob8078
blobs58078
blooie310078
bo08
bob808
bobbies5318808
bobble378808
bobbles5378808
bobs5808
bog908
boggish4519908
boggle379908
boggles5379908
bogie31908
bogies531908
bogle37908
bogles537908
bogs5908
boil7108
boils57108
bole3708
boles53708
boll7708
bolls57708
bolo0708
bolos50708
bolshie3145708
bolshies53145708
boo008
boob8008
boobie318008
boobies5318008
boobish4518008
booboo008008
booboos5008008
boobs58008
boogie319008
boogies5319008
boohoo004008
boohoos5004008
boos5008
booze32008
boozes532008
bos508
bosh4508
boshes534508
boss5508
bosses535508
bossies5315508
bozo0208
bozos50208
ebb883
ebbs5883
eel733
eels5733
egg993
eggless5537993
eggs5993
eggshell77345993
egis5193
egises535193
ego093
egoless5537093
egos5093
eh43
el73
elegies5319373
elegise3519373
elegises53519373
elegize3219373
elegizes53219373
elhi1473
eligible37819173
ell773
ells5773
els573
else3573
es53
eses5353
ess553
esses53553
gee339
gees5339
geese35339
geez2339
gel739
gelee33739
gelees533739
gels5739
gesso05539
gessoes5305539
ghee3349
ghees53349
ghi149
ghibli178149
ghiblis5178149
ghillie3177149
ghillies53177149
ghis5149
gib819
gibbose3508819
gibe3819
gibes53819
gibs5819
gie319
gies5319
gig919
giggle379919
giggles5379919
gighe34919
gigolo070919
gigolos5070919
gigs5919
gill7719
gillie317719
gillies5317719
gills57719
glebe38379
glebes538379
glee3379
glees53379
gleg9379
glib8179
glob8079
globe38079
globes538079
globose3508079
globs58079
glogg99079
gloggs599079
gloss55079
glosses5355079
glossies53155079
gloze32079
glozes532079
go09
gob809
gobble378809
gobbles5378809
gobies531809
gobo0809
goboes530809
gobos50809
gobs5809
goes5309
goggle379909
goggles5379909
gogo0909
gogos50909
golosh450709
goloshe3450709
goloshes53450709
goo009
googlies53179009
googol709009
googols5709009
goos5009
goose35009
gooses535009
gosh4509
he34
hebe3834
hebes53834
heel7334
heelless55377334
heels57334
heeze32334
heezes532334
heh434
hehs5434
heigh49134
heil7134
heils57134
heishi145134
helio01734
helios501734
hell7734
hellhole37047734
hellish4517734
hello07734
helloes5307734
hellos507734
hells57734
helo0734
helos50734
hes534
hi14
hie314
hies5314
higgle379914
higgles5379914
high4914
highs54914
hili1714
hill7714
hillo07714
hilloes5307714
hillos507714
hills57714
his514
hiss5514
hisses535514
hissies5315514
ho04
hob804
hobbies5318804
hobble378804
hobbles5378804
hobo0804
hoboes530804
hobos50804
hobs5804
hoe304
hoes5304
hog904
hogg9904
hoggish4519904
hoggs59904
hogs5904
hoise35104
hoises535104
hole3704
holeless55373704
holes53704
holies531704
hollies5317704
hollo07704
holloes5307704
holloo007704
holloos5007704
hollos507704
hols5704
hoolie317004
hose3504
hosel73504
hosels573504
hoses53504
ibis5181
ibises535181
igloo00791
igloos500791
ill771
ills5771
is51
isle3751
isleless55373751
isles53751
isogloss55079051
isohel734051
isohels5734051
isolog907051
isologs5907051
issei13551
isseis513551
lee337
lees5337
leg937
leges53937
legible3781937
legless5537937
legs5937
lei137
leis5137
less5537
lessee335537
lessees5335537
lez237
lezzes532237
lezzie312237
lezzies5312237
li17
lib817
libel73817
libelee3373817
libelees53373817
libellee33773817
libels573817
libs5817
lie317
liege39317
lieges539317
lies5317
lilies531717
lis517
lisle37517
lisles537517
lo07
lob807
lobbies5318807
lobe3807
lobes53807
lobo0807
lobos50807
lobs5807
loess55307
loesses5355307
log907
loge3907
loges53907
loggie319907
logo0907
logoi10907
logos50907
logs5907
loll7707
lollies5317707
lolls57707
loo007
loobies5318007
looie31007
looies531007
loos5007
loose35007
looses535007
lose3507
losel73507
losels573507
loses53507
loss5507
losses535507
obe380
obeli17380
obelise3517380
obelises53517380
obelize3217380
obelizes53217380
obes5380
obese35380
obi180
obis5180
oblige391780
obligee3391780
obligees53391780
obliges5391780
oboe3080
oboes53080
obol7080
obole37080
oboles537080
oboli17080
obols57080
obsess553580
obsesses53553580
oe30
oes530
ogee3390
ogees53390
ogle3790
ogles53790
oh40
oho040
ohs540
oil710
oilhole3704710
oilholes53704710
oils5710
ole370
oleo0370
oleos50370
oles5370
olio0170
olios50170
ologies5319070
ooh400
oohs5400
oologies53190700
ooze3200
oozes53200
os50
ose350
oses5350
see335
seel7335
seels57335
sees5335
seg935
sego0935
segos50935
segs5935
sei135
seis5135
seise35135
seises535135
seize32135
seizes532135
sel735
sell7735
selle37735
selles537735
sells57735
sels5735
sessile3715535
sh45
she345
shell77345
shells577345
sheol70345
sheols570345
shes5345
shh445
shiel73145
shiels573145
shies53145
shill77145
shills577145
shoe3045
shoebill77183045
shoeless55373045
shoes53045
shog9045
shogs59045
shoo0045
shool70045
shools570045
shoos50045
si15
sib815
sibb8815
sibbs58815
sibs5815
siege39315
sieges539315
sigh4915
sighless55374915
sighs54915
sigil71915
sigils571915
sigloi107915
siglos507915
sill7715
sillies5317715
sills57715
silo0715
silos50715
sis515
sises53515
sissies5315515
size3215
sizes53215
sizzle372215
sizzles5372215
sleigh491375
sleighs5491375
slob8075
slobbish45188075
slobs58075
sloe3075
sloes53075
slog9075
slogs59075
slosh45075
sloshes5345075
so05
sob805
sobs5805
soil7105
soilless55377105
soils57105
sol705
sole3705
solei13705
soleless55373705
soles53705
solgel739705
soli1705
solo0705
solos50705
sols5705
sos505
zee332
zees5332
zig912
zigs5912
zill7712
zills57712
zizzle372212
zizzles5372212
zoo002
zoos5002



#! /usr/bin/env python
import string

beghilets = ['b', 'e', 'h', 'i', 'l', 'o', 's', 'z', 'g']
calcLets = ['B', 'E', 'h', 'I', 'L', 'O', 'S', 'Z', 'G']
calcNums = ['8', '3', '4', '1', '7', '0', '5', '2', '9']
fDict = open('dictionary.txt', 'r')
fWords = open('All_Beghilos.txt', 'w')
count = 0
maxWordLen = 0
line = fDict.readline()
while line != '':
line = string.strip(line)
line = string.lower(line)
if len(line) > maxWordLen:
maxWordLen = len(line)
calcWord = ""
calcNumber = ""
isBeghilo = True
for i in range(len(line)):
isBeghilet = False
j = 0
for let in beghilets:
if line[i] == let:
calcWord += calcLets[j]
calcNumber += calcNums[j]
isBeghilet = True
j += 1
if isBeghilet == False:
isBeghilo = False
if isBeghilo == True:
fWords.write(line.ljust(maxWordLen+1)+" "+calcWord.ljust(maxWordLen+1)+" "+calcNumber[::-1]+'\n')
count += 1
line = fDict.readline()
fWords.write("%d total words" % (count))
fWords.close()
fDict.close()


Friday, March 21, 2008

Why do we write?

What makes me want to get a blog? Why write stuff down for the world to see? Is it to bequeath my vast knowledge to future generations? Could I be doing it for selfish reasons, to vent when angry or explain myself when happy? I don't know. Maybe because its for the same reason the late Edmund Hillary gave for scaling Mount Everest. Because it was there. Do I blog just because there is a website here that will publish my thoughts? Do I really have a purpose? Right now, I can't think of a single one.
I can say this, scaling Mount Everest just because it is there seems really silly. Maybe starting a blog is silly too.