Index: chrome/browser/history/scored_history_match.h |
diff --git a/chrome/browser/history/scored_history_match.h b/chrome/browser/history/scored_history_match.h |
index c10f4f3b70d881f3c5dc81cd1d5b95c685ca436b..60ee92d5541a305d097fa445eda37487a0f69c81 100644 |
--- a/chrome/browser/history/scored_history_match.h |
+++ b/chrome/browser/history/scored_history_match.h |
@@ -38,12 +38,22 @@ struct ScoredHistoryMatch : public history::HistoryMatch { |
BookmarkService* bookmark_service); |
~ScoredHistoryMatch(); |
- // Calculates a component score based on position, ordering and total |
- // substring match size using metrics recorded in |matches|. |max_length| |
- // is the length of the string against which the terms are being searched. |
+ // Calculates a component score based on position, ordering, word |
+ // boundaries, and total substring match size using metrics recorded |
+ // in |matches| and |word_starts|. |max_length| is the length of |
+ // the string against which the terms are being searched. |
static int ScoreComponentForMatches(const TermMatches& matches, |
Bart N.
2012/11/29 17:32:26
matches -> provided_matches to make it consistent
Mark P
2012/11/29 19:36:48
Done.
|
+ const WordStarts& word_starts, |
size_t max_length); |
+ // Given a set of term matches |matches| and word boundaries |word_starts|, |
+ // fills in |matches_at_word_boundaries| with only the matches in |matches| |
+ // that are at word boundaries. |
+ static void MakeTermMatchesOnlyAtWordBoundaries( |
+ const TermMatches& matches, |
+ const WordStarts& word_starts, |
+ TermMatches* matches_at_word_boundaries); |
+ |
// Converts a raw value for some particular scoring factor into a score |
// component for that factor. The conversion function is piecewise linear, |
// with input values provided in |value_ranks| and resulting output scores |
@@ -102,6 +112,9 @@ struct ScoredHistoryMatch : public history::HistoryMatch { |
// field trial state. |
static void InitializeNewScoringField(); |
+ // Sets only_count_matches_at_word_boundaries based on the field trial state. |
+ static void InitializeOnlyCountMatchesAtWordBoundariesField(); |
+ |
// Sets also_do_hup_like_scoring based on the field trial state. |
static void InitializeAlsoDoHUPLikeScoringField(); |
@@ -134,7 +147,8 @@ struct ScoredHistoryMatch : public history::HistoryMatch { |
static const int kMaxRawTermScore = 30; |
static float* raw_term_score_to_topicality_score; |
- // Allows us to determing setting for use_new_scoring_ only once. |
+ // Allows us to determing setting for use_new_scoring_ and other startup |
Bart N.
2012/11/29 17:32:26
-> |use_new_scoring| (extra _)?
Mark P
2012/11/29 19:36:48
Rephrased entirely.
|
+ // calculations only once. |
static bool initialized_; |
// Whether to use new-scoring or old-scoring. Set in the |
@@ -145,6 +159,9 @@ struct ScoredHistoryMatch : public history::HistoryMatch { |
// class as well (see boolean below). |
static bool use_new_scoring; |
+ // If true, we ignore all matches that are in the middle of a word. |
+ static bool only_count_matches_at_word_boundaries; |
+ |
// If true, assign raw scores to be max(whatever it normally would be, |
// a score that's similar to the score HistoryURL provider would assign). |
// This variable is set in the constructor by examining the field trial |