code: private void apply(HyphenationPattern pattern, int pos) {
  
      int internalOffset = pos - 2;
      HyphenationPatternPosition[] positions = pattern.getHyphenationPositions();
      for (HyphenationPatternPosition hyphenationPosition : positions) {
        int i = hyphenationPosition.index + internalOffset;
        if ((i >= 0) && (i < this.rankings.length) && (hyphenationPosition.ranking > this.rankings[i])) {
          this.rankings[i] = hyphenationPosition.ranking;
        }
      }
    }
docs: This method applies the {@link HyphenationPattern pattern} matching at the given {@code offset}.
  
  @param pattern is the matching {@link HyphenationPattern pattern}.
  @param pos is the offset in the word to hyphenate.