<commit_before>var lacona = require('lacona');
var substrings = require('lacona-util-phrasehelpers').substrings;

module.exports = lacona.createPhrase({
	name: 'lacona/validator',
	getDefaultProps: function () {
		return {
			default: function (done) { done(); },
			validate: function (input, done) { done(null, true); }
		};
	},
	validate: function (inputString, data, done) {
		var this_ = this;

		if (inputString === '') {
			this_.props.default(function (err, suggestion) {
				if (err) {
					return done(err);
				} else if (suggestion || suggestion === '') {
					data({text: suggestion, value: suggestion});
				}
			});
		} else {
			substrings(inputString, this.props.splitOn).forEach(function (stringPart) {
				this_.props.validate(stringPart, function (err, isValid) {
					if (err) {
						return done(err);
					} else if (isValid) {
						data({text: stringPart, value: stringPart});
					}
				});
			});
		}

		done();
	},
	getValue: function (result) {
		return result.value;
	},
	describe: function () {
		return lacona.value({
			compute: this.validate,
			id: 'value',
			limit: this.props.limit,
			fuzzy: this.props.fuzzy
		});
	}
});<commit_msg>Completely disable fuzzy matching for validator<commit_after>var lacona = require('lacona');
var substrings = require('lacona-util-phrasehelpers').substrings;

module.exports = lacona.createPhrase({
	name: 'lacona/validator',
	getDefaultProps: function () {
		return {
			default: function (done) { done(); },
			validate: function (input, done) { done(null, true); }
		};
	},
	validate: function (inputString, data, done) {
		var this_ = this;

		if (inputString === '') {
			this_.props.default(function (err, suggestion) {
				if (err) {
					return done(err);
				} else if (suggestion || suggestion === '') {
					data({text: suggestion, value: suggestion});
				}
			});
		} else {
			substrings(inputString, this.props.splitOn).forEach(function (stringPart) {
				this_.props.validate(stringPart, function (err, isValid) {
					if (err) {
						return done(err);
					} else if (isValid) {
						data({text: stringPart, value: stringPart});
					}
				});
			});
		}

		done();
	},
	getValue: function (result) {
		return result.value;
	},
	describe: function () {
		return lacona.value({
			compute: this.validate,
			id: 'value',
			limit: this.props.limit,
			fuzzy: 'none'
		});
	}
});
{'fraction_non_alphanumeric': 0.16469594594594594, 'fraction_numerical': 0.0, 'mean_word_length': 3.387037037037037, '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': '4578084', 'n_tokens_mistral': 933, 'n_tokens_neox': 769, 'n_words': 175}