lefthand.frink

Download or view lefthand.frink in plain text format

// Find words that can be typed using only the left hand on a QWERTY keyboard.

// The wordlist files are part of the Moby wordlist project, available at:
//   http://icon.shef.ac.uk/Moby/
infile = "file:/home/eliasen/prog/mobydict/mwords/singlewords.txt"

// Pattern which matches words containing only the
// characters under the left hand on a QWERTY keyboard
leftPattern = { |w| w =~ %r/^[qwertasdfgzxcvb]+$/i }

// Pick out words that match the pattern
matches = select[lines[infile], leftPattern]

// Length sort
sort[matches, { |a,b| length[a] <=> length[b] }]

for line = matches
   println[length[line] + ": $line"]


Download or view lefthand.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 20217 days, 23 hours, 47 minutes ago.