Package org.apache.uima.simpleserver.config

Examples of org.apache.uima.simpleserver.config.Filter


        exc.add(new SimpleServerException(SimpleServerException.type_does_not_exist,
            new Object[] { typeMap.getTypeName() }));
        continue;
      }
      // Now go through the filter and outputs and check each path for validity
      Filter filter = typeMap.getFilter();
      if (filter != null) {
        checkFilter(filter, type, exc);
      }
      checkOutputs(typeMap.getOutputs(), type, exc);
    }
View Full Code Here


  }

  // Read a type element.
  private static TypeMap readTypeMap(TypeElementType typeBean) throws SimpleServerException {
    boolean coveredText = typeBean.getOutputCoveredText();
    Filter filter = null;
    // Check if type element has a filter, and what kind of filter it is (atomic filter, and, or).
    if (typeBean.getFilters() != null) {
      Filters filterBean = typeBean.getFilters();
      if (filterBean.getAnd() != null) {
        filter = readFilter(filterBean.getAnd());
View Full Code Here

    return typeMap;
  }

  // Process a filter bean.
  private static final Filter readFilter(FilterType filterBean) throws SimpleServerException {
    Filter filter = null;
    // Need to distinguish the various kinds of filters.
    if (filterBean instanceof And) {
      filter = readAndFilter((And) filterBean);
    } else if (filterBean instanceof Or) {
      filter = readOrFilter((Or) filterBean);
View Full Code Here

      }
      // Iterate over FSs, filter and create output.
      FSIterator iterator = cas.getAnnotationIndex(type).iterator();
      for (; iterator.isValid(); iterator.moveToNext()) {
        AnnotationFS annotation = (AnnotationFS) iterator.get();
        Filter filter = tspec.getFilter();
        // Check that there either is no filter, or the FS passes the filter.
        if ((filter == null) || filter.match(annotation)) {
          // Create a new result entry, fill with attributes and add result set.
          ResultEntryImpl resultEntry = new ResultEntryImpl(tspec.getOutputTag(), annotation
              .getBegin(), annotation.getEnd());
          makeOutputs(resultEntry, annotation, tspec);
          resultEntries.add(resultEntry);
View Full Code Here

TOP

Related Classes of org.apache.uima.simpleserver.config.Filter

Copyright © 2018 www.massapicom. 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.