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

Side by Side Diff: third_party/document_image_extractor/src/document_feature.js

Issue 1138123002: Update third_party/document_image_extractor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 goog.provide('image.collections.extension.DocumentFeature'); 5 goog.provide('image.collections.extension.domextractor.DocumentFeature');
6 6
7 goog.scope(function() { 7 goog.scope(function() {
8 8
9 9
10 10
11 /** 11 /**
12 * This is a base class for all document features (e.g. title, snippet, image). 12 * This is a base class for all document features (e.g. title, snippet, image).
13 * @param {number} relevance Relevance of this feature to the document. 13 * @param {number} relevance Relevance of this feature to the document.
14 * @constructor 14 * @constructor
15 */ 15 */
16 image.collections.extension.DocumentFeature = function(relevance) { 16 image.collections.extension.domextractor.DocumentFeature = function(relevance) {
17 /** @private {number} */ 17 /** @private {number} */
18 this.relevance_ = relevance; 18 this.relevance_ = relevance;
19 }; 19 };
20 var DocumentFeature = image.collections.extension.DocumentFeature; 20 var DocumentFeature = image.collections.extension.domextractor.DocumentFeature;
21 21
22 22
23 /** 23 /**
24 * Returns the feature relevance. 24 * Returns the feature relevance.
25 * @return {number} 25 * @return {number}
26 */ 26 */
27 DocumentFeature.prototype.getRelevance = function() { 27 DocumentFeature.prototype.getRelevance = function() {
28 return this.relevance_; 28 return this.relevance_;
29 }; 29 };
30 30
31 31
32 /** 32 /**
33 * Compares two document features by their relevance. 33 * Compares two document features by their relevance.
34 * @param {!DocumentFeature} feature1 34 * @param {!DocumentFeature} feature1
35 * @param {!DocumentFeature} feature2 35 * @param {!DocumentFeature} feature2
36 * @return {number} 36 * @return {number}
37 */ 37 */
38 DocumentFeature.compare = function(feature1, feature2) { 38 DocumentFeature.compare = function(feature1, feature2) {
39 if (feature1 == feature2) { 39 if (feature1 == feature2) {
40 return 0; 40 return 0;
41 } 41 }
42 return feature1.getRelevance() - feature2.getRelevance(); 42 return feature1.getRelevance() - feature2.getRelevance();
43 }; 43 };
44 }); // goog.scope 44 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698