Package net.sourceforge.segment.srx

Examples of net.sourceforge.segment.srx.LanguageRule.addRule()


        } else {
          after = "";
        }

        Rule rule = new Rule(breakRule, before, after);
        languageRule.addRule(rule);
      }
      languageRuleMap.put(languageRule.getName(), languageRule);
    }

    for (Languagemap lm : body.getMaprules().getLanguagemap()) {
View Full Code Here


  private LanguageRule generateLanguageRule(int ruleCount, int ruleLenght) {
    LanguageRule languageRule = new LanguageRule("");
    // Add rules
    for (int i = 0; i < ruleCount; ++i) {
      Rule rule = generateRule(ruleLenght);
      languageRule.addRule(rule);
    }
    // Add end of sentence rule
    languageRule.addRule(new Rule(true, "\\.", " "));
    return languageRule;
  }
View Full Code Here

    for (int i = 0; i < ruleCount; ++i) {
      Rule rule = generateRule(ruleLenght);
      languageRule.addRule(rule);
    }
    // Add end of sentence rule
    languageRule.addRule(new Rule(true, "\\.", " "));
    return languageRule;
  }

  private Rule generateRule(int length) {
    StringBuilder regex = new StringBuilder();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.