philc/vimium — pull request #722 by smblott-github (2012-11-14 12:36:31+00:00)
Title: Word relevancy improvements - incorporate the position at which matches occur.

Implements #705. See that post for the basic idea and its justification.

Comments:
- The structure of the `wordRelevancy` calculation is unchanged and should be recognisable.
- The code contains *extensive* comments and explanation. These should be removed prior to the PR being committed.
- I've included three possible "endings" to `wordRelevancy`, two of which are commented out. The most intriguing of these is the third (see code). Feedback on that "ending" would be particularly welcome.
- The PR currently includes unit tests which involve *exact matches of floating point numbers*. It is possible that these may fail on some platforms. It is my intention that these tests be removed before the PR is committed.

Costs:
- There are no additional costs for suggestions which do not match.
- There is one additional `RegExp` test for each suggestion which matches.
- There is one further additional `RegExp` test for each suggestion which matches at the start of a word.