needsLongToothU static method

bool needsLongToothU(
  1. String word,
  2. int uIndex
)

Implementation

static bool needsLongToothU(String word, int uIndex) {
  if (uIndex < 0) return false;

  if (word.codeUnitAt(uIndex) != Unicode.OE &&
      word.codeUnitAt(uIndex) != Unicode.UE) return false;

  if (uIndex == 0) return true;

  if (uIndex == 1) {
    if (isConsonant(word.codeUnitAt(0))) {
      // strange BUU exception
      return _BUU_EXCEPTION != word;
    }
  }

  //noinspection SimplifiableIfStatement
  if (uIndex == 2) {
    return isConsonant(word.codeUnitAt(0)) &&
        MongolCode.isFVS(word.codeUnitAt(1));
  }

  return false;
}