giorgiosironi/eris — pull request #27 by giorgiosironi (2014-12-14 15:12:48+00:00)
Title: A spike on names shrinking

A Generator for names. Fortunately there is no emergent design to test-driven develop, computer science has already done everything for us:
* a public dataset of 10K names is used for generation
* shrinking looks at the names with 1 character less than the current one (both for optimization and also to guarantee shrinking terminates in a finite number of steps)
* the best candidate is chosen through Levenshtein distance, although it is not domain-specific for names (valid for all strings) so I will try to implement Jaro-Winkler which is designed for this job

Examples:
```
array(11) {
[0] =>
string(12) "Konstantinos"
[1] =>
string(11) "Constantino"
[2] =>
string(10) "Constantin"
[3] =>
string(9) "Constanta"
[4] =>
string(8) "Constant"
[5] =>
string(7) "Conrart"
[6] =>
string(6) "Conrad"
[7] =>
string(5) "Coral"
[8] =>
string(4) "Cora"
[9] =>
string(3) "Cob"
[10] =>
string(2) "Jo"
}
array(8) {
[0] =>
string(9) "Donatilla"
[1] =>
string(8) "Donatina"
[2] =>
string(7) "Donatio"
[3] =>
string(6) "Donato"
[4] =>
string(5) "Donat"
[5] =>
string(4) "Dona"
[6] =>
string(3) "Don"
[7] =>
string(2) "Di"
}
array(5) {
[0] =>
string(6) "Ocne"
[1] =>
string(5) "Lne"
[2] =>
string(4) "Jane"
[3] =>
string(3) "Jan"
[4] =>
string(2) "Jo"
}
array(10) {
[0] =>
string(11) "Solanghjula"
[1] =>
string(10) "Colombella"
[2] =>
string(9) "Colombina"
[3] =>
string(8) "Colombia"
[4] =>
string(7) "Colomba"
[5] =>
string(6) "Colina"
[6] =>
string(5) "Colin"
[7] =>
string(4) "Alin"
[8] =>
string(3) "Ali"
[9] =>
string(2) "Di"
}

array(6) {
[0] =>
string(7) "Malachy"
[1] =>
string(6) "Magaly"
[2] =>
string(5) "Maggy"
[3] =>
string(4) "Mady"
[4] =>
string(3) "Mad"
[5] =>
string(2) "Ed"
}
```