function scoreToken(token) {
  if (isArray(token)) {
    return Math.max(...token.map(scoreToken));
  }

  const modifier = Math.log(token.value.length);

  if (!token.match) {
    return -0.07 * modifier;
  }

  return (
    token.start
      ? (
        token.end
          ? 131.9
          : 7.87
      )
      : (
        token.wordStart
          ? 2.19
          : 1
      )
  ) * modifier;
}
Score a token based on its characteristics
and the length of the matched content.

@param { Token } token

@returns { number }