diff options
| author | Stephen Blott | 2015-05-16 13:12:25 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-05-16 13:12:25 +0100 |
| commit | 87c214ffd80ac436273f35fd95c800589e3f7d4a (patch) | |
| tree | 8dd72a7d4232c649ca1e721efbd35389df893d79 | |
| parent | 148f1b44bcbe7df030ac9f95498826ee66f0a9cd (diff) | |
| download | vimium-87c214ffd80ac436273f35fd95c800589e3f7d4a.tar.bz2 | |
Search completion; tweak comments.
| -rw-r--r-- | background_scripts/completion.coffee | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index 0675d13f..a8f160d0 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -155,8 +155,9 @@ class Suggestion [ '.', [ "^https?://", "\\W+$" ].map (re) -> new RegExp re ] ] - # Boost a score by a factor (in the range (0,1.0)), while keeping the score in the range [0,1]. This makes - # greater adjustments to scores near the middle of the range (so, very poor relevancy scores remain poor). + # Boost a relevancy score by a factor (in the range (0,1.0)), while keeping the score in the range [0,1]. + # This makes greater adjustments to scores near the middle of the range (so, very poor relevancy scores + # remain very poor). @boostRelevancyScore: (factor, score) -> score + if score < 0.5 then score * factor else (1.0 - score) * factor @@ -453,9 +454,8 @@ class SearchEngineCompleter factor = Math.max 0.0, Math.min 1.0, Settings.get "omniSearchWeight" haveCompletionEngine = (0.0 < factor or custom) and CompletionSearch.haveCompletionEngine searchUrl - # We weight the relevancy-score factor by the length of the query (exponentially). The idea is that, the - # more the user has typed, the less likely it is that what the user is searching for is amonst the - # suggestions from other completers. + # We weight the relevancy factor by the length of the query (exponentially). The idea is that, the + # more the user has typed, the less likely it is that another completer has proven fruitful. factor *= 1 - Math.pow 0.8, query.length # This filter is applied to all of the suggestions from all of the completers, after they have been @@ -495,7 +495,7 @@ class SearchEngineCompleter isCustomSearch: custom relevancyFunction: @computeRelevancy # We reduce the relevancy factor as suggestions are added. This respects, to some extent, the - # suggestion order provided by the completion engine. + # order provided by the completion engine. relevancyData: factor *= 0.95 cachedSuggestions = |
