abbrev

Abbrev provides a procedure for calculating the set of unique abbreviations for a given set of words. (Borrowed from Ruby's Abbrev.)

  shortcuts := abbrev(["lisp", "scheme", "scala"])
  shortcuts["l"] => "lisp"
  shortcuts["sca"] => "scala"

Procedures

abbrev (strings, prefix)

Given a list of strings, returns a table with all unambiguous abbrev->string mappings.

The optional prefix specifies a required prefix for all abbreviations.


Home