Hyphenator constructor

Hyphenator({
  1. required ResourceLoader resource,
  2. String hyphenateSymbol = '\u{00AD}',
  3. int minWordLength = 5,
  4. int minLetterCount = 3,
})

Implementation

Hyphenator({
  required ResourceLoader resource,
  this.hyphenateSymbol = '\u{00AD}',
  this.minWordLength = 5,
  this.minLetterCount = 3,
})  : assert(minWordLength > 0),
      _patterns = resource.patternsStrings
          .map(
            (pattern) => Pattern.from(pattern),
          )
          .toList()
            ..sort() {
  _exceptions.addEntries(
    resource.exceptionsStrings.map(
      (exception) => MapEntry(
        exception.replaceAll(_exceptionDelimiter, ''),
        _createExceptionMask(exception),
      ),
    ),
  );
}