Skip to content

Instantly share code, notes, and snippets.

@atnan
Created August 17, 2010 04:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save atnan/528501 to your computer and use it in GitHub Desktop.
Save atnan/528501 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Get a sample dictionary here:
# http://labs.kitiyo.com/files/t9.dic
umask 077
NUMN=/tmp/numn.$$
trap "exit 1" HUP INT PIPE QUIT TERM
trap "rm -f $DICTN $NUMN" EXIT
cat t9.dic | tr a-z 22233344455566677778889999 > $NUMN
if [ $# -eq 0 ] ; then
echo "Usage : t9.sh "
exit 1;
else
paste -d: $NUMN t9.dic | grep "^$1" | cut -d":" -f2 | sort
fi
@dsturnbull
Copy link

Nice. Shown blackdog? :)

@atnan
Copy link
Author

atnan commented Aug 17, 2010

Who's blackdog?

@dsturnbull
Copy link

@atnan
Copy link
Author

atnan commented Aug 17, 2010

I don't think he would be very interested, because there's no prediction going on here (i.e. I'm ignoring the hard part of the problem).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment