Interface Action

  • All Superinterfaces:
    Serializable
    All Known Implementing Classes:
    Annotate, ImportDocuments, KeywordExtraction, SpellChecker, TermCounts

    public interface Action
    extends Serializable

    An action defines a processing step to perform on a Corpus with a given Context which results in either modifying the corpus or the context. Action implementations can persist their state to be reused at a later time including across jvm instances & runs. This is done by implementing the loadPreviousState(DocumentCollection, Context) method. An action can ignore its state and reprocess the corpus when either the config setting processing.override.all is set to true or the config setting className.override is set tp true.

    Author:
    David B. Bracewell
    • Method Detail

      • getOverrideStatus

        default boolean getOverrideStatus()
        Gets the override status for this processing module, which can be defined using configuration in the form fully.qualified.class.name.override=true or all processing can be reperformed using processing.override.all=true. By default, the status is false, which means try to load the previous state.
        Returns:
        True force reprocessing, False try to load the previous state.
      • loadPreviousState

        default State loadPreviousState​(DocumentCollection corpus,
                                        Context context)
        Loads from a previous processing state.
        Parameters:
        corpus - the corpus being processed
        context - the context of the processor
        Returns:
        the processing state (NOT_LOADED by default meaning there is no previous state).