code: public void apply(HyphenationPattern pattern) {
  
      String wordPart = pattern.getWordPart();
      int wordPartLength = wordPart.length();
      int wordPartHash = pattern.getWordPartHash();
      int[] subHashes = getHashes(wordPartLength);
      if (subHashes.length == 0) {
        return;
      }
      int start = 0;
      int end = subHashes.length - 1;
      if (wordPart.charAt(0) == HyphenationPattern.TERMINATOR) {
        end = 0;
      } else if (wordPart.charAt(wordPartLength - 1) == HyphenationPattern.TERMINATOR) {
        start = end;
      }
      for (int i = start; i <= end; i++) {
        if (subHashes[i] == wordPartHash) {
          if (isSubstring(this.normalizedWord, wordPart, i)) {
            apply(pattern, i);
          }
        }
      }
    }
docs: This is the heart of the hyphenation algorithm. It checks if the {@link HyphenationPattern pattern} is a
  substring of the
  
  
  @param pattern is the pattern to check and potentially apply.