class PunctuationCheckRule extends AbstractPunctuationCheckRule {

  private static final Pattern PATTERN_1 = Pattern.compile("([,:] | *- |,- | ) *");
  private static final Pattern PATTERN_2 = Pattern.compile("([.!?]|!!!|\\?\\?\\?|\\?!!|!\\.\\.|\\?\\.\\.|\\.\\.\\.) *");
  private static final Pattern PATTERN_3 = Pattern.compile("^[.,!?: -]$");

  public PunctuationCheckRule(ResourceBundle messages) {
    super(messages);
    // super.setCategory(new Category(messages.getString("category_misc")));
  }

  // private boolean isTripleOk(String token) {
  // return token.matches("^[.!?]$");
  // }

  /*
   * (non-Javadoc)
   * 
   * @see
   * org.languagetool.rules.AbstractPunctuationCheckRule#isPunctsJoinOk
   * (java.lang.String)
   */
  @Override
  protected final boolean isPunctsJoinOk(String tokens) {<FILL_FUNCTION_BODY>}

  /*
   * (non-Javadoc)
   * 
   * @see
   * org.languagetool.rules.AbstractPunctuationCheckRule#isPunctuation
   * (java.lang.String)
   */
  @Override
  protected final boolean isPunctuation(String token) {
    return PATTERN_3.matcher(token).matches();
  }

}

    return // we ignore duplicated spaces - too many errors
           PATTERN_1.matcher(tokens).matches() // internal punctuation
        || PATTERN_2.matcher(tokens).matches();
  
<methods>public void <init>(java.util.ResourceBundle) ,public java.lang.String getDescription() ,public java.lang.String getId() ,public org.languagetool.rules.RuleMatch[] match(org.languagetool.AnalyzedSentence) <variables>