class RegexExpander {

  private final static List<String> entities = Arrays.asList(
        "       <!ENTITY conjuncoes_coordenativas \"(?:e(?:ntão|ntretanto)?|p(?:ois|orém|or(?:t|qu)anto)|mas|ou|nem|contudo|logo|todavia)\">");
  private final static String wordListFile = "/home/dnaber/lt/pt-words.txt";
  private final static Set<String> printed = new HashSet<>();

  public static void main(String[] args) throws IOException {<FILL_FUNCTION_BODY>}

  private static void printToken(int i, String s) {
    if (i == 0) {
      System.out.print(s);
    } else {
      System.out.print("|" + s);
    }
    printed.add(s);
  }

}

    //Pattern tempP = Pattern.compile("(?:e(?:stere|ur|g)|(?:cent|sac)r|a(?:str|udi)|t(?:erm|urb)|f(?:il|ot)|i(?:ntr|d)|bronc|labi|mon|vas|zo)o");
    //System.out.println(tempP.matcher("estereo").matches());
    //System.exit(0);
    List<String> lines = Files.readAllLines(Paths.get(wordListFile));
    for (String s : entities) {

      Matcher matcher = Pattern.compile("<!ENTITY (.*?) ").matcher(s);
      boolean found = matcher.find();
      if (!found) {
        System.out.println("Entity name not found: " + s);
      }
      String entityName = matcher.group(1);
      s = s.replaceFirst("<!ENTITY .*? \"(.*)\">", "$1").trim();
      System.out.print("<!ENTITY " + entityName + " \"");
      Pattern p = Pattern.compile(s);
      int i = 0;
      for (String line : lines) {
        line = line.trim();
        boolean lcMatch = false;
        boolean ucMatch = false;
        if (p.matcher(line).matches()) {
          lcMatch = true;
        }
        if (StringTools.startsWithLowercase(line) && p.matcher(uppercaseFirstChar(line)).matches()) {
          ucMatch = true;
        }
        if (lcMatch && ucMatch) {
          printToken(i, "[" + uppercaseFirstChar(line).charAt(0) + StringTools.lowercaseFirstChar(line).charAt(0) + "]" + line.substring(1));
          i++;
        } else if (lcMatch && !printed.contains(line)) {
          printToken(i, line);
          i++;
        } else if (ucMatch && !printed.contains(uppercaseFirstChar(line))) {
          printToken(i, uppercaseFirstChar(line));
          i++;
        }
      }
      System.out.println("\">");
    }
  
<no_super_class>