static relatedness(target, candidate) {
    const LanguageUtils = shaka.util.LanguageUtils;

    target = LanguageUtils.normalize(target);
    candidate = LanguageUtils.normalize(candidate);

    // An exact match is the top score.
    if (candidate == target) {
      return 4;
    }

    // Next is a parent of the target language.
    if (LanguageUtils.isParentOf(candidate, target)) {
      return 3;
    }

    // Next is a sibling of the target language.
    if (LanguageUtils.isSiblingOf(candidate, target)) {
      return 2;
    }

    // Next is a child of the target language.
    if (LanguageUtils.isParentOf(target, candidate)) {
      return 1;
    }

    // Otherwise, they are unrelated.
    return 0;
  }
Compute a numerical relatedness for language codes.  Language codes with a
higher relatedness are a better match.  Unrelated language codes have a
relatedness score of 0.

@param {string} target
@param {string} candidate
@return {number}
@export