garybernhardt/selecta — pull request #20 by airblade (2013-11-06 15:32:29+00:00)
Title: Scoring algorithm takes more factors into account.

- Prefers letters at the start of "words"
- Prefers contiguous letters to isolated letters.

The extra weighting these factors get is tuneable.

Original algorithm's benchmark on my MBP:

```
$ ruby benchmark.rb
Benchmark runtimes (lower is always better):
non-matching: 0.003037
matching exactly: 0.033162
matching broken up: 0.032146
overlapping matches: 0.105529
words, non-matching: 0.226345
words, matching: 0.251849
```

New algorithm's benchmark on my MBP:

```
$ ruby benchmark.rb
Benchmark runtimes (lower is always better):
non-matching: 0.00301
matching exactly: 0.030033
matching broken up: 0.031277
overlapping matches: 0.102469
words, non-matching: 0.226749
words, matching: 0.246938
```