export const count = (sentence: string): Map<string, number> => 
  sentence
    .toLowerCase()
    .trim()
    .replace(/^'(.*?)'$/, '$1')
    .split(/[^a-zA-Z0-9']/)
    .map(value => value.trim().replace(/^'(.*?)'$/, '$1'))
    .filter(Boolean)
    .reduce(
      (acc, word) => acc.set(word, (acc.get(word) || 0) + 1),
      new Map<string, number>()
    );
