lefthand.frink

View or download 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"]


View or download 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 17646 days, 9 hours, 36 minutes ago.