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

Unified Diff: chrome/browser/history/scored_history_match.cc

Issue 300433003: Code cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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 | « chrome/browser/history/scored_history_match.h ('k') | chrome/browser/history/url_index_private_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/scored_history_match.cc
diff --git a/chrome/browser/history/scored_history_match.cc b/chrome/browser/history/scored_history_match.cc
index e713b2575df6caf2d206ec399eb901b3bd96db01..53565e734fb83c44a9e1aa1a92e4f1f051d3cc63 100644
--- a/chrome/browser/history/scored_history_match.cc
+++ b/chrome/browser/history/scored_history_match.cc
@@ -152,9 +152,9 @@ ScoredHistoryMatch::ScoredHistoryMatch(
const float topicality_score = GetTopicalityScore(
terms.size(), url, terms_to_word_starts_offsets, word_starts);
- const float frecency_score = GetFrecency(
+ const float frequency_score = GetFrequency(
now, (bookmark_service && bookmark_service->IsBookmarked(gurl)), visits);
- raw_score_ = GetFinalRelevancyScore(topicality_score, frecency_score);
+ raw_score_ = GetFinalRelevancyScore(topicality_score, frequency_score);
raw_score_ =
(raw_score_ <= kint32max) ? static_cast<int>(raw_score_) : kint32max;
@@ -519,9 +519,9 @@ void ScoredHistoryMatch::FillInDaysAgoToRecencyScoreArray() {
}
// static
-float ScoredHistoryMatch::GetFrecency(const base::Time& now,
- const bool bookmarked,
- const VisitInfoVector& visits) {
+float ScoredHistoryMatch::GetFrequency(const base::Time& now,
+ const bool bookmarked,
+ const VisitInfoVector& visits) {
// Compute the weighted average |value_of_transition| over the last at
// most kMaxVisitsToScore visits, where each visit is weighted using
// GetRecencyScore() based on how many days ago it happened. Use
@@ -543,14 +543,14 @@ float ScoredHistoryMatch::GetFrecency(const base::Time& now,
// static
float ScoredHistoryMatch::GetFinalRelevancyScore(float topicality_score,
- float frecency_score) {
+ float frequency_score) {
if (topicality_score == 0)
return 0;
// Here's how to interpret intermediate_score: Suppose the omnibox
// has one input term. Suppose we have a URL for which the omnibox
// input term has a single URL hostname hit at a word boundary. (This
// implies topicality_score = 1.0.). Then the intermediate_score for
- // this URL will depend entirely on the frecency_score with
+ // this URL will depend entirely on the frequency_score with
// this interpretation:
// - a single typed visit more than three months ago, no other visits -> 0.2
// - a visit every three days, no typed visits -> 0.706
@@ -559,7 +559,7 @@ float ScoredHistoryMatch::GetFinalRelevancyScore(float topicality_score,
// - a typed visit once a week -> 11.77
// - a typed visit every three days -> 14.12
// - at least ten typed visits today -> 20.0 (maximum score)
- const float intermediate_score = topicality_score * frecency_score;
+ const float intermediate_score = topicality_score * frequency_score;
// The below code maps intermediate_score to the range [0, 1399].
// The score maxes out at 1400 (i.e., cannot beat a good inline result).
if (intermediate_score <= 1) {
« no previous file with comments | « chrome/browser/history/scored_history_match.h ('k') | chrome/browser/history/url_index_private_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698