hyphenateWord method

String hyphenateWord(
  1. String inputWord
)

Implementation

String hyphenateWord(String inputWord) {
  if (_isNotNeedHyphenate(inputWord)) return inputWord;

  final word = inputWord.toLowerCase();

  List<int>? hyphenationMask;

  if (_exceptions.containsKey(word))
    hyphenationMask = _exceptions[word];
  else {
    final levels = _generateLevelsForWord(word);
    hyphenationMask = _hyphenatedMaskFromLevels(levels);
    _correctHyphenationMask(hyphenationMask);
  }

  return _hyphenateByMask(inputWord, hyphenationMask);
}