I’m trying to get the words that only differ from one character. but i’m stuck in almostmatch method. can you help me?

I’m trying to get the words that only differ from one character.
but i’m stuck in almostmatch method. can you help me?
word.txt
band
bent
bike
boat
card
cash
cast
coat
cold
cord
core
cost
dame
dash
dear
deck
deer
deme
dime
dine
dinn
dish
dive
dome
door
dorm
face
fake
fast
find
fine
finn
fire
fish
fold
folk
fore
hard
hash
hear
held
help
here
hire
hold
host
knot
kunn
kuns
lake
land
lase
last
lice
like
lime
line
linn
live
lost
love
lunn
main
make
mash
maze
meta
mice
mien
mike
milk
mind
mine
mink
more
most
must
nash
neck
nice
nick
nine
nuns
pain
pine
pond
pony
poor
pour
rain
rash
rick
rime
rust
sake
sand
sane
sick
silk
sine
sony
sure
tiny
vice
vide
ward
warm
worm
(){