class CompoundRule extends AbstractCompoundRule {
  
  // static to make sure this gets loaded only once:
  private static volatile CompoundRuleData compoundData;
  private static final Language AMERICAN_ENGLISH = Languages.getLanguageForShortCode("en-US");
  private static final List<DisambiguationPatternRule> ANTI_PATTERNS = makeAntiPatterns(Arrays.asList(
      Arrays.asList(
        tokenRegex("['’`´‘]"),
        token("re")
      ),
      Arrays.asList( // We well received your email
        new PatternTokenBuilder().posRegex("SENT_START|CC|PCT").build(),
        tokenRegex("we|you|they|I|s?he|it"),
        token("well"),
        new PatternTokenBuilder().posRegex("VB.*").build()
      ),
      Arrays.asList(
        tokenRegex("and|&"),
        token("co")
      ),
      Arrays.asList( // off-key
        token("power"),
        token("off"),
        token("key")
      ),
      Arrays.asList( // see saw seen
        token("see"),
        token("saw"),
        token("seen")
      ),
      Arrays.asList( // moving forward looking for ...
        token("forward"),
        token("looking"),
        new PatternTokenBuilder().posRegex("IN|TO").build()
      ),
      Arrays.asList( // Go through the store front door
        token("store"),
        token("front"),
        tokenRegex("doors?")
      ),
      Arrays.asList( // It goes from surface to surface
        token("from"),
        token("surface"),
        token("to"),
        token("surface")
      ),
      Arrays.asList( // year end
        tokenRegex("senior|junior"),
        token("year"),
        token("end")
      ),
      Arrays.asList( // under investment 
        token("under"),
        token("investment"),
        token("banking")
      ),
      Arrays.asList( // spring clean
        token("spring"),
        tokenRegex("cleans?|cleaned|cleaning"),
        tokenRegex("up|the|my|our|his|her")
      ),
      Arrays.asList( // Serie A team (A-Team)
        tokenRegex("series?"),
        tokenRegex("a")
      ),
      Arrays.asList( // They had a hard time sharing their ... 
        token("hard"),
        token("time"),
        new PatternTokenBuilder().pos("VBG").build()
      ),
      Arrays.asList( // the first ever green bond by a municipality
        token("first"),
        tokenRegex("ever"),
        tokenRegex("green")
      ),
      Arrays.asList( // inter-state.com
        tokenRegex(".+"),
        token("."),
        tokenRegex("(com|io|de|nl|co|net|org|es)")
      )
  ), AMERICAN_ENGLISH);
  private final Language english;

  public CompoundRule(ResourceBundle messages, Language english, UserConfig userConfig) throws IOException {
    super(messages, english, userConfig,
            "This word is normally spelled with a hyphen.",
            "This word is normally spelled as one.", 
            "This expression is normally spelled as one or with a hyphen.",
            "Compound");
    this.english = english;
    super.useSubRuleSpecificIds();
    addExamplePair(Example.wrong("I now have a <marker>part time</marker> job."),
                   Example.fixed("I now have a <marker>part-time</marker> job."));
    setUrl(Tools.getUrl("https://languagetool.org/insights/post/hyphen/"));
  }

  @Override
  public String getId() {
    return "EN_COMPOUNDS";
  }

  @Override
  public String getDescription() {
    return "Hyphenated words: $match";
  }

  @Override
  public CompoundRuleData getCompoundRuleData() {<FILL_FUNCTION_BODY>}

  @Override
  public List<DisambiguationPatternRule> getAntiPatterns() {
    return ANTI_PATTERNS;
  }
  
  @Override
  public boolean isMisspelled(String word) throws IOException {
    //return !EnglishTagger.INSTANCE.tag(Arrays.asList(word)).get(0).isTagged();
    return Objects.requireNonNull(english.getDefaultSpellingRule()).isMisspelled(word);
  }
}

    CompoundRuleData data = compoundData;
    if (data == null) {
      synchronized (CompoundRule.class) {
        data = compoundData;
        if (data == null) {
          compoundData = data = new CompoundRuleData("/en/compounds.txt");
        }
      }
    }

    return data;
  
<methods>public void <init>(java.util.ResourceBundle, org.languagetool.Language, org.languagetool.UserConfig, java.lang.String, java.lang.String, java.lang.String) throws java.io.IOException,public void <init>(java.util.ResourceBundle, org.languagetool.Language, org.languagetool.UserConfig, java.lang.String, java.lang.String, java.lang.String, java.lang.String) throws java.io.IOException,public int estimateContextForSureMatch() ,public abstract org.languagetool.rules.CompoundRuleData getCompoundRuleData() ,public abstract java.lang.String getDescription() ,public abstract java.lang.String getId() ,public boolean isMisspelled(java.lang.String) throws java.io.IOException,public org.languagetool.rules.RuleMatch[] match(org.languagetool.AnalyzedSentence) throws java.io.IOException,public java.lang.String mergeCompound(java.lang.String, boolean) ,public void useSubRuleSpecificIds() <variables>private static final java.util.regex.Pattern DASHES,private static final java.util.regex.Pattern DIGIT,static final int MAX_TERMS,private static final java.util.regex.Pattern WHITESPACE,private static final java.util.regex.Pattern WHITESPACE_DASH,protected final non-sealed org.languagetool.Language lang,protected final non-sealed org.languagetool.LinguServices linguServices,protected boolean sentenceStartsWithUpperCase,private final non-sealed java.lang.String shortDesc,protected boolean subRuleSpecificIds,private final non-sealed java.lang.String withHyphenMessage,private final non-sealed java.lang.String withOrWithoutHyphenMessage,private final non-sealed java.lang.String withoutHyphenMessage