Nextrans String Similarity
npm install nextrans-check-name-similarity
import StringSimiliarity from 'nextrans-check-name-similarity';
const {
MIN_VALIDATE_NAME_SENSITIVITY = 0.85,
MIN_VALIDATE_SHORT_NAME_SENSITIVITY = 0.65,
MAX_SHORT_NAME_LENGTH = 8,
} = process.env;
const stringSimilarity = new StringSimiliarity({
minValidateNameSensitivity: +MIN_VALIDATE_NAME_SENSITIVITY,
minValidateShortNameSensitivity: +MIN_VALIDATE_SHORT_NAME_SENSITIVITY,
maxShortNameLength: +MAX_SHORT_NAME_LENGTH,
});
console.log(stringSimilarity.validateBeneficiary('Ujang Kalong', 'Ujang Marujang'));