Class ExtractionParameters


  • public class ExtractionParameters
    extends Object
    This class models the parameters to be used to perform an extraction. See org.apache.any23.Any23 for more details.
    Author:
    Michele Mostarda (mostarda@fbk.eu)
    • Constructor Detail

      • ExtractionParameters

        public ExtractionParameters​(Configuration configuration,
                                    ExtractionParameters.ValidationMode extractionMode,
                                    Map<String,​Boolean> extractionFlags,
                                    Map<String,​String> extractionProperties)
        Constructor.
        Parameters:
        configuration - underlying configuration.
        extractionMode - specifies the required extraction mode.
        extractionFlags - map of specific flags used for extraction. If not specified they will be retrieved by the default Configuration.
        extractionProperties - map of specific properties used for extraction. If not specified they will ne retrieved by the default Configuration.
      • ExtractionParameters

        public ExtractionParameters​(Configuration configuration,
                                    ExtractionParameters.ValidationMode extractionMode)
        Constructor.
        Parameters:
        configuration - underlying configuration.
        extractionMode - specifies the required extraction mode.
      • ExtractionParameters

        public ExtractionParameters​(Configuration configuration,
                                    ExtractionParameters.ValidationMode extractionMode,
                                    boolean nesting)
        Constructor, allows to set explicitly the value for flag SingleDocumentExtraction#METADATA_NESTING_FLAG.
        Parameters:
        configuration - the underlying configuration.
        extractionMode - specifies the required extraction mode.
        nesting - if true nesting triples will be expressed.
    • Method Detail

      • newDefault

        public static final ExtractionParameters newDefault​(Configuration c)
        Parameters:
        c - the underlying configuration.
        Returns:
        the default extraction parameters.
      • isValidate

        public boolean isValidate()
        Returns:
        true if validation is active.
      • isFix

        public boolean isFix()
        Returns:
        true if fix is active.
      • getFlag

        public boolean getFlag​(String flagName)
        Returns the value of the specified extraction flag, if the flag is undefined it will be retrieved by the default Configuration.
        Parameters:
        flagName - name of flag.
        Returns:
        flag value.
      • setFlag

        public Boolean setFlag​(String flagName,
                               boolean value)
        Sets the value for an extraction flag.
        Parameters:
        flagName - flag name.
        value - new flag value.
        Returns:
        the previous flag value.
      • getProperty

        public String getProperty​(String propertyName)
        Returns the value of the specified extraction property, if the property is undefined it will be retrieved by the default Configuration.
        Parameters:
        propertyName - the property name.
        Returns:
        the property value.
        Throws:
        IllegalArgumentException - if the property name is not defined in configuration.
      • setProperty

        public String setProperty​(String propertyName,
                                  String propertyValue)
        Sets the value for an extraction property.
        Parameters:
        propertyName - the property name.
        propertyValue - the property value.
        Returns:
        the previous property value.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object