Examples of groupCount()


Examples of edu.washington.cs.knowitall.sequence.LayeredTokenMatcher.groupCount()

    protected Collection<SpanExtraction> extractCandidates(ChunkedSentence sent)
            throws ExtractorException {
        LayeredTokenMatcher m = pattern.matcher(sent);
        List<SpanExtraction> results = new ArrayList<SpanExtraction>();
        while (m.find()) {
            int numFields = m.groupCount();
            List<Range> fieldRanges = new ArrayList<Range>();
            for (int i = 0; i < numFields; i++) {
                int start = m.start(i + 1);
                int end = m.end(i + 1);
                int len = end - start;
View Full Code Here

Examples of java.util.regex.MatchResult.groupCount()

      Matcher matcher = pattern.matcher(eventStr);
      if (! matcher.matches()) {
        continue;
      }
      MatchResult res = matcher.toMatchResult();
      for (int grp=1; grp <= res.groupCount(); grp++) {
        String value = res.group(grp);
        if (grp == SYSLOG_TIMESTAMP_POS) {
          timeStampString = value;

          // apply available format replacements to timestamp
View Full Code Here

Examples of java.util.regex.Matcher.groupCount()

    }

    final Matcher matcher = PATTERN.matcher(input);

    while (matcher.find()) {
      for (int i = 1; i <= matcher.groupCount(); i++) {
        if (matcher.group(i) != null) {
          switch (i) {
            case 1: // literal string
              node_list.add(TextNode.create(matcher.group(i)));
              break;
View Full Code Here

Examples of java.util.regex.Matcher.groupCount()

        Matcher m = pattern.matcher(parser.get(range));
        if (!m.matches()) {
            parser.recordError(range, SCHEME_PATTERN_MATCH_FAILED);
            return;
        }
        for (int g = 1; g <= m.groupCount(); g++)
            if (m.start(g) != -1)
                actions[g].check(m, parser, range);

    }
}
View Full Code Here

Examples of java.util.regex.Matcher.groupCount()

    private int classify(String string) {
        Matcher m = keyword.matcher(string);
        if (!m.matches())
            return OTHER;
        for (int i = 1; i <= m.groupCount(); i++)
            if (m.start(i) != -1)
                return i;
        throw new IllegalStateException(
                "IRI code internal error: no group matched.");
    }
View Full Code Here

Examples of java.util.regex.Matcher.groupCount()

      }
     
      Matcher seen_matcher = DO_PATTERN.matcher(arguments);
     
      if (!seen_matcher.matches() ||
        seen_matcher.groupCount() != 2)
      {
        bot.send(new Privmsg(nick, "Invalid syntax '" + command + " " + arguments + "'"));
        return;
      }
     
View Full Code Here

Examples of java.util.regex.Matcher.groupCount()

      }
     
      Matcher seen_matcher = SAY_PATTERN.matcher(arguments);
     
      if (!seen_matcher.matches() ||
        seen_matcher.groupCount() != 2)
      {
        bot.send(new Privmsg(nick, "Invalid syntax '"+command+" "+arguments+"'"));
        return;
      }
     
View Full Code Here

Examples of java.util.regex.Matcher.groupCount()

        }

        Matcher logsearch_matcher = SEARCH_PATTERN.matcher(arguments);

        if (!logsearch_matcher.matches() ||
          logsearch_matcher.groupCount() != 2)
        {
          bot.send(new Privmsg(nick, "Invalid syntax '"+command+" "+arguments+"'"));
          return;
        }
View Full Code Here

Examples of java.util.regex.Matcher.groupCount()

      }
     
      Matcher seen_matcher = SEEN_PATTERN.matcher(arguments.toLowerCase());
     
      if (!seen_matcher.matches() ||
        seen_matcher.groupCount() != 2)
      {
        bot.send(new Privmsg(nick, "Invalid syntax '"+command+" "+arguments+"'"));
        return;
      }
     
View Full Code Here

Examples of java.util.regex.Matcher.groupCount()

      }
     
      Matcher register_matcher = REGISTER_PATTERN.matcher(arguments);
     
      if (!register_matcher.matches() ||
        register_matcher.groupCount() != 2)
      {
        bot.send(new Privmsg(nick, "Invalid syntax '"+command+" "+arguments+"'"));
        return;
      }
     
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.