Examples of RuleMatcher


Examples of com.mossle.bpm.rule.RuleMatcher

    private Map<RuleMatcher, AssigneeRule> assigneeRuleMap = new HashMap<RuleMatcher, AssigneeRule>();

    public AssigneeAliasTaskListener() {
        SuperiorAssigneeRule superiorAssigneeRule = new SuperiorAssigneeRule();
        PositionAssigneeRule positionAssigneeRule = new PositionAssigneeRule();
        assigneeRuleMap.put(new RuleMatcher("常用语"), superiorAssigneeRule);
        assigneeRuleMap.put(new RuleMatcher("岗位"), positionAssigneeRule);
    }
View Full Code Here

Examples of com.mossle.bpm.rule.RuleMatcher

        String assignee = delegateTask.getAssignee();
        logger.debug("assignee : {}", assignee);

        for (Map.Entry<RuleMatcher, AssigneeRule> entry : assigneeRuleMap
                .entrySet()) {
            RuleMatcher ruleMatcher = entry.getKey();

            if (!ruleMatcher.matches(assignee)) {
                continue;
            }

            String value = ruleMatcher.getValue(assignee);
            AssigneeRule assigneeRule = entry.getValue();
            logger.debug("value : {}", value);
            logger.debug("assigneeRule : {}", assigneeRule);

            if (assigneeRule instanceof SuperiorAssigneeRule) {
View Full Code Here

Examples of com.santiagolizardo.beobachter.beans.RuleMatcher

  public void loadLogType(LogType logType) {
    List<Rule> rules = logType.getRules();
    ruleMatchers = new RuleMatcher[rules.size()];
    for (int i = 0; i < rules.size(); i++) {
      ruleMatchers[i] = new RuleMatcher(rules.get(i));
    }
  }
View Full Code Here

Examples of net.sourceforge.segment.srx.RuleMatcher

    this.endPosition = 0;

    this.ruleMatcherList = new LinkedList<RuleMatcher>();
    for (LanguageRule languageRule : languageRuleList) {
      for (Rule rule : languageRule.getRuleList()) {
        RuleMatcher matcher = new RuleMatcher(document, rule, text);
        ruleMatcherList.add(matcher);
      }
    }

  }
View Full Code Here

Examples of net.sourceforge.segment.srx.RuleMatcher

      if (segment == null) {
        initMatchers();
      }
      boolean found = false;
      while ((ruleMatcherList.size() > 0) && !found) {
        RuleMatcher minMatcher = getMinMatcher();
        endPosition = minMatcher.getBreakPosition();
        if (minMatcher.getRule().isBreak() &&
            endPosition > startPosition) {
          found = true;
          cutMatchers();
        }
        moveMatchers();
View Full Code Here

Examples of net.sourceforge.segment.srx.RuleMatcher

    return (startPosition < text.length());
  }
 
  private void initMatchers() {
    for (Iterator<RuleMatcher> i = ruleMatcherList.iterator(); i.hasNext();) {
      RuleMatcher matcher = i.next();
      matcher.find();
      if (matcher.hitEnd()) {
        i.remove();
      }
    }
  }
View Full Code Here

Examples of net.sourceforge.segment.srx.RuleMatcher

  /**
   * Przesuwa iteratory na kolejną pozycje jeśli to konieczne.
   */
  private void moveMatchers() {
    for (Iterator<RuleMatcher> i = ruleMatcherList.iterator(); i.hasNext();) {
      RuleMatcher matcher = i.next();
      while (matcher.getBreakPosition() <= endPosition) {
        matcher.find();
        if (matcher.hitEnd()) {
          i.remove();
          break;
        }
      }
    }
View Full Code Here

Examples of net.sourceforge.segment.srx.RuleMatcher

  /**
   * Move matchers that start before previous segment end.
   */
  private void cutMatchers() {
    for (Iterator<RuleMatcher> i = ruleMatcherList.iterator(); i.hasNext();) {
      RuleMatcher matcher = i.next();
      if (matcher.getStartPosition() < endPosition) {
        matcher.find(endPosition);
        if (matcher.hitEnd()) {
          i.remove();
        }
      }
    }
  }
View Full Code Here

Examples of net.sourceforge.segment.srx.RuleMatcher

  /**
   * @return Zwraca iterator pierwszego trafionego dopasowania
   */
  private RuleMatcher getMinMatcher() {
    int minPosition = Integer.MAX_VALUE;
    RuleMatcher minMatcher = null;
    for (RuleMatcher matcher : ruleMatcherList) {
      if (matcher.getBreakPosition() < minPosition) {
        minPosition = matcher.getBreakPosition();
        minMatcher = matcher;
      }
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.