Example #1
0
  protected void setActualModifiers(Hashtable table) throws RuleException {
    try {
      if (prefixModifier != null) {
        prefixModifier.setActualSubRules(table, EDITION_CODES_NOT_ALLOWED);
      }

      if (suffixModifier != null) {
        suffixModifier.setActualSubRules(table, EDITION_CODES_NOT_ALLOWED);
      }

      if (separatorModifier != null) {
        separatorModifier.setActualSubRules(table, EDITION_CODES_NOT_ALLOWED);
      }

      if (nullModifier != null) {
        nullModifier.setActualSubRules(table, EDITION_CODES_NOT_ALLOWED);
      }

      if (fileModifier != null) {
        fileModifier.setActualSubRules(table, EDITION_CODES_NOT_ALLOWED);
      }
    } catch (RuleException ex) {
      String old_msg = ex.getMessage();
      String msg = ErrorInRuleException.buildMessage(m_ruleName, old_msg);
      throw new ErrorInRuleException(msg);
    }
  } // end setActualModifiers()
Example #2
0
 public void testWordRule() {
   PoemRule poemRule =
       new PoemRule(
           "my_rule",
           "above|across|against|along|among|around|before|behind|beneath|beside|between|beyond|during|inside|onto|outside|under|underneath|upon|with|without|through <NOUN>|<PRONOUN>|<ADJECTIVE>");
   try {
     assertTrue(poemRule.getRuleWords().contains("beneath"));
   } catch (RuleException e) {
     fail(e.getMessage());
   }
 }