java.lang.Object
es.uvigo.esei.sing.textproc.step.AbstractProcessingStep
es.uvigo.esei.sing.textproc.abstracttppstep.AbstractTppProcessingStep
All Implemented Interfaces:
es.uvigo.esei.sing.textproc.step.internal.ProcessingStepInterface

public abstract class AbstractTppProcessingStep
extends AbstractProcessingStep
Handles common processing logic to all processing steps that call the Text Processing Python web service for processing documents.
Author:
Alejandro González García
  • Constructor Details

    • AbstractTppProcessingStep

      protected AbstractTppProcessingStep​(java.util.Map<java.lang.String,​java.util.function.Predicate<java.lang.String>> validationPredicates, java.util.Set<java.lang.String> requiredParameters, @NonNull @NonNull java.util.List<java.lang.Class<? extends ProcessedDocument>> processedDocumentTypes, @NonNull @NonNull java.lang.String stepDescriptionFormatString, @NonNull @NonNull JsonResponseAttributeType jsonResponseAttributeType, @NonNull @NonNull AbstractProcessingStep.ProcessingConsumer<? super javax.json.stream.JsonGenerator> requestParametersAction, @NonNull @NonNull ProcessingBiConsumer<? super java.util.Map.Entry<java.lang.String,​javax.json.JsonObject>,​? super java.util.Map<java.lang.String,​java.lang.String>> storeProcessedAttributeAction)
      Creates a new processing step that processes documents via calls to the Text Processing Python web service.
      Parameters:
      validationPredicates - A map with additional parameter validation predicates, specific to the concrete processing step.
      requiredParameters - A set with additional mandatory parameters, specific to this processing step.
      processedDocumentTypes - The processed entity types generated by the particular processing step. At the moment, this must be a list of two processed document types, where the first one is interpreted as the resulting type for titled documents, and the second one is the resulting type for untitled documents. The format of this list may be changed in the future if more unprocessed document types are added.
      stepDescriptionFormatString - A format string (as defined by Formatter) that will be used for generating a user-friendly step activity description string. It will receive a single string parameter with the name of the unprocessed entity that is being processed.
      jsonResponseAttributeType - The expected JSON type of processed document attributes in the web service response.
      requestParametersAction - The action to execute to populate the request object with parameters, after the documents object.
      storeProcessedAttributeAction - An action that receives the JSON document object of the response, and is expected to put its processed form in the provided map.
      Throws:
      java.lang.IllegalArgumentException - If any parameter is null or invalid.
  • Method Details