library/normalization.js
function normalize(content) {
  if (!content) {
    if (!globalOptions.isSilentMode()) console.warn('Content must be specified on knayi.normalize.');
    return '';
  }

  const result = content
    .replace(/\u200B/g, '')
    .replace(brakePointRegex, (m, g1, g2) => {
      let chunk = g1 || '';

      // Re-ordering
      uniquify(g2)
        .sort((a,b) => rankingMap[a] - rankingMap[b])
        .forEach((v) => chunk += v);
     
      return applyReplacementRules(extendedRules, chunk);
    });
  
  return applyReplacementRules(postExtendedRules, result);
}
function normalize(content) {
  if (!content) {
    if (!globalOptions.isSilentMode()) console.warn('Content must be specified on knayi.normalize.');
    return '';
  }

  const result = content
    .replace(/\u200B/g, '')
    .replace(brakePointRegex, (m, g1, g2) => {
      let chunk = g1 || '';

      // Re-ordering
      uniquify(g2)
        .sort((a,b) => rankingMap[a] - rankingMap[b])
        .forEach((v) => chunk += v);
     
      return applyReplacementRules(extendedRules, chunk);
    });
  
  return applyReplacementRules(postExtendedRules, result);
}
function normalize ( content ) { if ( ! content ) { if ( ! globalOptions . isSilentMode ( ) ) console . warn ( 'Content must be specified on knayi.normalize.' ) ; return '' ; } const result = content . replace ( / \u200B / g , '' ) . replace ( brakePointRegex , ( m , g1 , g2 ) => { let chunk = g1 || '' ; // Re-ordering uniquify ( g2 ) . sort ( ( a , b ) => rankingMap [ a ] - rankingMap [ b ] ) . forEach ( ( v ) => chunk += v ) ; return applyReplacementRules ( extendedRules , chunk ) ; } ) ; return applyReplacementRules ( postExtendedRules , result ) ; }
Normalization basically do transforming text into a single canonical form
@param {String} content Context to normalize
Normalization basically do transforming text into a single canonical form