class EsperantoWordTokenizer extends WordTokenizer {

  private static final Pattern PATTERN_1 = Pattern.compile("(?<!')\\b([a-zA-ZĉĝĥĵŝŭĈĜĤĴŜŬ]+)'(?![a-zA-ZĉĝĥĵŝŭĈĜĤĴŜŬ-])");
  private static final Pattern PATTERN_2 = Pattern.compile("(?<!')\\b([a-zA-ZĉĝĥĵŝŭĈĜĤĴŜŬ]+)'(?=[a-zA-ZĉĝĥĵŝŭĈĜĤĴŜŬ-])");
  private static final Pattern PATTERN_3 = Pattern.compile("\u0001\u0001EO@APOS1\u0001\u0001");
  private static final Pattern PATTERN_4 = Pattern.compile("\u0001\u0001EO@APOS2\u0001\u0001");

  /**
   * Tokenizes just like WordTokenizer with the exception that words
   * such as "dank'" contain an apostrophe within it.
   * 
   * @param text
   *          - Text to tokenize
   * @return List of tokens.
   * 
   *         Note: a special string \u0001\u0001EO@APOS\u0001\u0001 is used to replace apostrophe
   *         during tokenizing.
   */
  @Override
  public List<String> tokenize(String text) {<FILL_FUNCTION_BODY>}
}

    // TODO: find a cleaner implementation, this is a hack

    String replaced = PATTERN_1.matcher(text).replaceAll("$1\u0001\u0001EO@APOS1\u0001\u0001");
    replaced = PATTERN_2.matcher(replaced).replaceAll("$1\u0001\u0001EO@APOS2\u0001\u0001 ");
    List<String> tokenList = super.tokenize(replaced);
    List<String> tokens = new ArrayList<>();

    // Put back apostrophes and remove spurious spaces.
    Iterator<String> itr = tokenList.iterator();
    while (itr.hasNext()) {
      String word = itr.next();
      if (word.endsWith("\u0001\u0001EO@APOS2\u0001\u0001")) {
        itr.next(); // Skip the next spurious white space.
      }
      word = PATTERN_3.matcher(word).replaceAll("'");
      word = PATTERN_4.matcher(word).replaceAll("'");
      tokens.add(word);
    }
    return tokens;
  
<methods>public non-sealed void <init>() ,public static List<java.lang.String> getProtocols() ,public java.lang.String getTokenizingCharacters() ,public boolean isCurrencyExpression(java.lang.String) ,public static boolean isEMail(java.lang.String) ,public static boolean isUrl(java.lang.String) ,public List<java.lang.String> replaceEmojis(java.lang.String) ,public List<java.lang.String> restoreEmojis(List<java.lang.String>, List<java.lang.String>) ,public List<java.lang.String> splitCurrencyExpression(java.lang.String) ,public List<java.lang.String> tokenize(java.lang.String) <variables>private static final java.util.regex.Pattern CURRENCY_EXPRESSION,private static final java.util.regex.Pattern CURRENCY_SYMBOLS,private static final java.util.regex.Pattern CURRENCY_VALUE,private static final java.util.regex.Pattern DOMAIN_CHARS,private static final java.util.regex.Pattern E_MAIL,private static final java.util.regex.Pattern NO_PROTOCOL_URL,private static final List<java.lang.String> PROTOCOLS,protected final java.lang.String REMOVED_EMOJI,private static final java.lang.String TOKENIZING_CHARACTERS,private static final java.util.regex.Pattern URL_CHARS