<commit_before>var label, description,
  behaviorName = 'soft-maxlength',
  _ = require('lodash'),
  stripTags = require('striptags'),
  references = require('../services/references'),
  refProp = references.referenceProperty,
  fieldProp = references.fieldProperty;

label = 'Max Length';
description = 'Some field values must be less than a certain length for consistent formatting across all syndications.';

/**
 * @param {string} value
 * @returns {string}
 */
function cleanValue(value) {
  var clean = stripTags(value);

  clean = clean.replace(/(\u00a0|&nbsp;|&#160;)/ig, ' '); // remove &nbsp;
  return clean;
}

/**
 * @param {string} componentName
 * @param {string} label
 * @param {string} ref
 * @returns {string}
 */
function getLabel(componentName, label, ref) {<commit_msg>use the same length calculation for soft-maxlength validation rule as the behavior<commit_after>var label, description,
  behaviorName = 'soft-maxlength',
  _ = require('lodash'),
  he = require('he'),
  stripTags = require('striptags'),
  references = require('../services/references'),
  refProp = references.referenceProperty,
  fieldProp = references.fieldProperty;

label = 'Max Length';
description = 'Some field values must be less than a certain length for consistent formatting across all syndications.';

/**
 * @param {string} value
 * @returns {string}
 */
function cleanValue(value) {
  var clean = he.decode(stripTags(value));

  return clean;
}

/**
 * @param {string} componentName
 * @param {string} label
 * @param {string} ref
 * @returns {string}
 */
function getLabel(componentName, label, ref) {
{'fraction_non_alphanumeric': 0.13939016801493467, 'fraction_numerical': 0.00373366521468575, 'mean_word_length': 4.722419928825623, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3499220', 'n_tokens_mistral': 472, 'n_tokens_neox': 463, 'n_words': 139}