Package org.apache.any23.extractor
Class ExtractionParameters
- java.lang.Object
-
- org.apache.any23.extractor.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)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ExtractionParameters.ValidationMode
Declares the supported validation actions.
-
Field Summary
Fields Modifier and Type Field Description static String
EXTRACTION_CONTEXT_IRI_PROPERTY
static String
METADATA_DOMAIN_PER_ENTITY_FLAG
static String
METADATA_NESTING_FLAG
static String
METADATA_TIMESIZE_FLAG
-
Constructor Summary
Constructors Constructor Description ExtractionParameters(Configuration configuration, ExtractionParameters.ValidationMode extractionMode)
Constructor.ExtractionParameters(Configuration configuration, ExtractionParameters.ValidationMode extractionMode, boolean nesting)
Constructor, allows to set explicitly the value for flag SingleDocumentExtraction#METADATA_NESTING_FLAG.ExtractionParameters(Configuration configuration, ExtractionParameters.ValidationMode extractionMode, Map<String,Boolean> extractionFlags, Map<String,String> extractionProperties)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
boolean
getFlag(String flagName)
Returns the value of the specified extraction flag, if the flag is undefined it will be retrieved by the defaultConfiguration
.String
getProperty(String propertyName)
Returns the value of the specified extraction property, if the property is undefined it will be retrieved by the defaultConfiguration
.int
hashCode()
boolean
isFix()
boolean
isValidate()
static ExtractionParameters
newDefault()
Creates the default extraction parameters withDefaultConfiguration
.static ExtractionParameters
newDefault(Configuration c)
Boolean
setFlag(String flagName, boolean value)
Sets the value for an extraction flag.String
setProperty(String propertyName, String propertyValue)
Sets the value for an extraction property.
-
-
-
Field Detail
-
METADATA_DOMAIN_PER_ENTITY_FLAG
public static final String METADATA_DOMAIN_PER_ENTITY_FLAG
- See Also:
- Constant Field Values
-
METADATA_NESTING_FLAG
public static final String METADATA_NESTING_FLAG
- See Also:
- Constant Field Values
-
METADATA_TIMESIZE_FLAG
public static final String METADATA_TIMESIZE_FLAG
- See Also:
- Constant Field Values
-
EXTRACTION_CONTEXT_IRI_PROPERTY
public static final String EXTRACTION_CONTEXT_IRI_PROPERTY
- See Also:
- Constant Field Values
-
-
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 defaultConfiguration
.extractionProperties
- map of specific properties used for extraction. If not specified they will ne retrieved by the defaultConfiguration
.
-
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
- iftrue
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.
-
newDefault
public static final ExtractionParameters newDefault()
Creates the default extraction parameters withDefaultConfiguration
.- 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 defaultConfiguration
.- 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 defaultConfiguration
.- 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.
-
-