Skip to content

insomniapps/crushinator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

The Crushinator
===============

A simple method of matching an irregular string against a set of known values for a match.

Examples
=======

  # pristine string
  "hello world".crushinate      # => "hlwrld"
  
  # irregular string
  "HELLLLO wurld ".crushinate   # => "hlwrld"

  
  # crushinate can be called on arrays to generate a map
  
  map = ["Elijah Miller", "Kris Chambers"].crushinate
  # => {"ljhmlr"=>"Elijah Miller", "krschmbrs"=>"Kris Chambers"}
  
  map["eli jah MILLLLLLER".crushinate]
  # => "Elijah Miller"
  
  
  # An exception will be raised if the map has collisions
  map = ["Elijah Miller", "eli jah miller"].crushinate
  # => RuntimeError: Duplicate crushinated strings for Elijah Miller and eli jah miller


Homepage: http://github.com/insomniapps/crushinator/tree/master  
Copyright (c) 2008 Elijah Miller <elijah.miller@gmail.com>, released under the MIT license.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages