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

Unified Diff: components/translate/core/browser/language_model.h

Issue 2391383005: [LanguageModel] Return top languages only with a reasonable sample set (Closed)
Patch Set: Fix the constructor Created 4 years, 2 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 | components/translate/core/browser/language_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/translate/core/browser/language_model.h
diff --git a/components/translate/core/browser/language_model.h b/components/translate/core/browser/language_model.h
index e8c4200713622a2059e9e4b2155434b8c9037b8d..c06caac1144344e68315ede6da72965f5bfe0a17 100644
--- a/components/translate/core/browser/language_model.h
+++ b/components/translate/core/browser/language_model.h
@@ -30,7 +30,7 @@ class LanguageModel : public KeyedService {
// The current estimated frequency of the language share, a number between 0
// and 1 (can be understood as the probability that the next page the user
// opens is in this language). Frequencies over all LanguageInfos from
- // GetTopLanguages() sum to 1.
+ // GetTopLanguages() sum to 1 (unless there are no top languages, yet).
float frequency;
bool operator==(const LanguageInfo& m) const {
@@ -45,7 +45,8 @@ class LanguageModel : public KeyedService {
static void RegisterProfilePrefs(PrefRegistrySimple* registry);
// Returns a list of the languages currently tracked by the model, sorted by
- // frequency in decreasing order.
+ // frequency in decreasing order. The list is empty, if the model has not
+ // enough data points.
std::vector<LanguageInfo> GetTopLanguages() const;
// Returns the estimated frequency for the given language or 0 if the language
« no previous file with comments | « no previous file | components/translate/core/browser/language_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698