<commit_before>goog.provide('ol.layer.Vector');

goog.require('ol.Feature');
goog.require('ol.layer.Layer');
goog.require('ol.source.Vector');
goog.require('ol.style.Style');



/**
 * @constructor
 * @extends {ol.layer.Layer}
 * @param {ol.layer.LayerOptions} layerOptions Layer options.
 */
ol.layer.Vector = function(layerOptions) {
  goog.base(this, layerOptions);

  /**
   * @private
   * @type {ol.style.Style}
   */
  this.style_ = goog.isDef(layerOptions.style) ? layerOptions.style : null;

};
goog.inherits(ol.layer.Vector, ol.layer.Layer);


/**
 * @return {ol.source.Vector} Source.
 */
ol.layer.Vector.prototype.getVectorSource = function() {
  return /** @type {ol.source.Vector} */ (this.getSource());
};


/**
 * @param {Array.<ol.Feature>} features Features.
 * @return {Array.<Array>} symbolizers for features.
 */
ol.layer.Vector.prototype.groupFeaturesBySymbolizerLiteral =
    function(features) {
  var uniqueLiterals = {},
      featuresBySymbolizer = [],
      style = this.style_,
      feature, literals, literal, key;
  for (var i = 0, ii = features.length; i < ii; ++i) {
    feature = features[i];
    literals = goog.isNull(style) ?
        ol.style.Style.applyDefaultStyle(feature) :
        style.apply(feature);
    for (var j = 0, jj = literals.length; j < jj; ++j) {
      literal = literals[j];
      for (var l in uniqueLiterals) {
        if (literal.equals(uniqueLiterals[l])) {
          literal = uniqueLiterals[l];
          break;
        }
      }
      key = goog.getUid(literal);
      if (!goog.object.containsKey(uniqueLiterals, key)) {
        uniqueLiterals[key] = featuresBySymbolizer.length;
        featuresBySymbolizer.push([[], literal]);
      }
      featuresBySymbolizer[uniqueLiterals[key]][0].push(feature);
    }
  }
  return featuresBySymbolizer;
};<commit_msg>Use the actual value, not just the index in the array.<commit_after>goog.provide('ol.layer.Vector');

goog.require('ol.Feature');
goog.require('ol.layer.Layer');
goog.require('ol.source.Vector');
goog.require('ol.style.Style');



/**
 * @constructor
 * @extends {ol.layer.Layer}
 * @param {ol.layer.LayerOptions} layerOptions Layer options.
 */
ol.layer.Vector = function(layerOptions) {
  goog.base(this, layerOptions);

  /**
   * @private
   * @type {ol.style.Style}
   */
  this.style_ = goog.isDef(layerOptions.style) ? layerOptions.style : null;

};
goog.inherits(ol.layer.Vector, ol.layer.Layer);


/**
 * @return {ol.source.Vector} Source.
 */
ol.layer.Vector.prototype.getVectorSource = function() {
  return /** @type {ol.source.Vector} */ (this.getSource());
};


/**
 * @param {Array.<ol.Feature>} features Features.
 * @return {Array.<Array>} symbolizers for features.
 */
ol.layer.Vector.prototype.groupFeaturesBySymbolizerLiteral =
    function(features) {
  var uniqueLiterals = {},
      featuresBySymbolizer = [],
      style = this.style_,
      feature, literals, literal, uniqueLiteral, key;
  for (var i = 0, ii = features.length; i < ii; ++i) {
    feature = features[i];
    literals = goog.isNull(style) ?
        ol.style.Style.applyDefaultStyle(feature) :
        style.apply(feature);
    for (var j = 0, jj = literals.length; j < jj; ++j) {
      literal = literals[j];
      for (var l in uniqueLiterals) {
        uniqueLiteral = featuresBySymbolizer[uniqueLiterals[key]][1];
        if (literal.equals(uniqueLiteral)) {
          literal = uniqueLiteral;
          break;
        }
      }
      key = goog.getUid(literal);
      if (!goog.object.containsKey(uniqueLiterals, key)) {
        uniqueLiterals[key] = featuresBySymbolizer.length;
        featuresBySymbolizer.push([[], literal]);
      }
      featuresBySymbolizer[uniqueLiterals[key]][0].push(feature);
    }
  }
  return featuresBySymbolizer;
};
{'fraction_non_alphanumeric': 0.16064790228359002, 'fraction_numerical': 0.0018587360594795538, 'mean_word_length': 3.26131221719457, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '787262', 'n_tokens_mistral': 1247, 'n_tokens_neox': 1203, 'n_words': 219}