зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1330973 - Use website description length for highlights ranking. r=Grisha
MozReview-Commit-ID: 7kZjNb2MSJ7 --HG-- extra : rebase_source : 8a5e12aaa78cee002330d57219465fd89c4c9c08
This commit is contained in:
Родитель
4e6612f2c4
Коммит
ff5dce313b
|
@ -118,10 +118,9 @@ import static org.mozilla.gecko.activitystream.ranking.RankingUtils.normalize;
|
|||
Math.max(1, System.currentTimeMillis() - cursor.getDouble(bookmarkDateColumnIndex)));
|
||||
}
|
||||
|
||||
// TODO: We do not know the description length yet. Let's assume it's 0 for now. (Bug 1330973)
|
||||
candidate.features.put(
|
||||
FEATURE_DESCRIPTION_LENGTH,
|
||||
0d);
|
||||
(double) candidate.highlight.getMetadata().getDescriptionLength());
|
||||
|
||||
final Uri uri = Uri.parse(candidate.highlight.getUrl());
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ package org.mozilla.gecko.activitystream.ranking;
|
|||
|
||||
import android.database.Cursor;
|
||||
import android.support.annotation.VisibleForTesting;
|
||||
import android.util.Log;
|
||||
|
||||
import org.mozilla.gecko.home.activitystream.model.Highlight;
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ public class Metadata {
|
|||
|
||||
private String provider;
|
||||
private String imageUrl;
|
||||
private int descriptionLength;
|
||||
|
||||
private Metadata(String json) {
|
||||
if (TextUtils.isEmpty(json)) {
|
||||
|
@ -36,6 +37,7 @@ public class Metadata {
|
|||
|
||||
provider = object.optString("provider");
|
||||
imageUrl = object.optString("image_url");
|
||||
descriptionLength = object.optInt("description_length");
|
||||
} catch (JSONException e) {
|
||||
Log.w(LOGTAG, "JSONException while parsing metadata", e);
|
||||
}
|
||||
|
@ -60,4 +62,8 @@ public class Metadata {
|
|||
public String getProvider() {
|
||||
return provider;
|
||||
}
|
||||
|
||||
public int getDescriptionLength() {
|
||||
return descriptionLength;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче