sclass MMO2_LinesToPattern implements IF1<Cl<S>, S> {
  bool forceStartOfLine = true;
  bool forceEndOfLine = true;
  bool allowTypos = true;
  
  public S get(Cl<S> lines) {
    ret mmo2_combineWithOr(lmap postProcess(
      uniquifySortedIC(lmap simplifyUsingParse3(lines))));
  }
  
  S postProcess(S s) {
    if (!allowTypos) s = joinWithSpace(appendToAll("!", parse3C(s)));
    if (forceStartOfLine) s = "^" + s;
    if (forceEndOfLine) s += "$";
    ret s;
  }
}