summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpearson@chromium.org <mpearson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-29 10:53:47 +0000
committermpearson@chromium.org <mpearson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-29 10:53:47 +0000
commitfcc4630532e6cba4e7e314fae8e5e83a3d7cc539 (patch)
tree0d316b9d9f5c572117911eb9eeeb5cbfd9a9badc
parentc71ebf36b10d2af41eb5f43e97e1642135f372c2 (diff)
downloadchromium_src-fcc4630532e6cba4e7e314fae8e5e83a3d7cc539.zip
chromium_src-fcc4630532e6cba4e7e314fae8e5e83a3d7cc539.tar.gz
chromium_src-fcc4630532e6cba4e7e314fae8e5e83a3d7cc539.tar.bz2
Omnibox: Improve Bookmarks Provider Comments
These improvement come from un-followed-up suggestions from https://codereview.chromium.org/10913262/ (The suggestions were offered after the code was submitted.) BUG= NOTRY=1 Review URL: https://chromiumcodereview.appspot.com/18083017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209280 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/autocomplete/bookmark_provider.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/chrome/browser/autocomplete/bookmark_provider.cc b/chrome/browser/autocomplete/bookmark_provider.cc
index dec4751..3e8443f 100644
--- a/chrome/browser/autocomplete/bookmark_provider.cc
+++ b/chrome/browser/autocomplete/bookmark_provider.cc
@@ -188,7 +188,7 @@ AutocompleteMatch BookmarkProvider::TitleMatchToACMatch(
// use the sum to figure out a value between the base score and the maximum
// score.
//
- // The factor for each term is calculated based on:
+ // The factor for each term is the product of:
//
// 1) how much of the bookmark's title has been matched by the term:
// (term length / title length).
@@ -209,8 +209,13 @@ AutocompleteMatch BookmarkProvider::TitleMatchToACMatch(
// a partial factor of (14-6)/14 = 0.571 ).
//
// Once all term factors have been calculated they are summed. The resulting
- // sum will never be greater than 1.0. This sum is then multiplied against
- // the scoring range available, which is 299. The 299 is calculated by
+ // sum will never be greater than 1.0 because of the way the bookmark model
+ // matches and removes overlaps. (In particular, the bookmark model only
+ // matches terms to the beginning of words and it removes all overlapping
+ // matches, keeping only the longest. Together these mean that each
+ // character is included in at most one match. This property ensures the
+ // sum of factors is at most 1.) This sum is then multiplied against the
+ // scoring range available, which is 299. The 299 is calculated by
// subtracting the minimum possible score, 900, from the maximum possible
// score, 1199. This product, ranging from 0 to 299, is added to the minimum
// possible score, 900, giving the preliminary score.