src/parsetree.js
function textToWords (text) {
  return text.toLowerCase()
    .replace(/[^a-z\s]/g,'')  // these are the phoneme characters we keep
    .replace(/\s+/g,' ').replace(/^ /,'').replace(/ $/,'')  // collapse all runs of space & remove start/end space
    .split(' ');
}
function textToWords (text) {
  return text.toLowerCase()
    .replace(/[^a-z\s]/g,'')  // these are the phoneme characters we keep
    .replace(/\s+/g,' ').replace(/^ /,'').replace(/ $/,'')  // collapse all runs of space & remove start/end space
    .split(' ');
}
function textToWords ( text ) { return text . toLowerCase ( ) . replace ( / [^a-z\s] / g , '' ) // these are the phoneme characters we keep . replace ( / \s+ / g , ' ' ) . replace ( / ^  / , '' ) . replace ( /  $ / , '' ) // collapse all runs of space & remove start/end space . split ( ' ' ) ; }
Text to words
Text to words