Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2114)

Unified Diff: chrome/browser/autocomplete/bookmark_provider.cc

Issue 18083017: Omnibox: Improve Bookmarks Provider Comments (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/bookmark_provider.cc
diff --git a/chrome/browser/autocomplete/bookmark_provider.cc b/chrome/browser/autocomplete/bookmark_provider.cc
index bee5367784ee7309754511e977e001a6c1a8a3e5..d4c79d5bf2fabfb4950fbbc09aec98957675ad73 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).
@@ -208,12 +208,18 @@ AutocompleteMatch BookmarkProvider::TitleMatchToACMatch(
// (with a a partial factor of (14-0)/14 = 1.000 ) than 'fghij' (with
// 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
- // 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.
+ // Once all term factors have been calculated they are summed. The
Peter Kasting 2013/06/28 22:18:22 How come you rewrapped this to have such shorter l
Mark P 2013/06/28 22:38:58 Re-wrapped by hand.
+ // resulting sum will never be greater than 1.0 because of the way
+ // the bookmark model matches and removes overlaps. (In particular,
+ // the bookmarks models only matches terms to the beginning of words
Peter Kasting 2013/06/28 22:18:22 Nit: bookmarks models -> bookmark model
Mark P 2013/06/28 22:38:58 Done.
+ // 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.
//
// If the preliminary score is less than the maximum possible score, 1199,
// it can be boosted up to that maximum possible score if the URL referenced
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698