Class ComparisonUtils
java.lang.Object
org.aksw.qa.annotation.comparison.ComparisonUtils
Offers functionality to extract superlatives and comparatives from strings and functions to retrieve properties and the order for a
comparative or superlative.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetComparatives(String question)Retrieves comparatives from the string.Returns the order for the given superlative or comparative which can then be used in SPARQL queries.getProperties(String comparison)Returns a list of properties for the given superlative or comparative (also works for the basic form of the supported adjectives).getSuperlatives(String question)Retrieves superlatives from the string.Retrieves a part of speech from the given string, depending on the parameter tag.
-
Field Details
-
PIPELINE
private static final edu.stanford.nlp.pipeline.StanfordCoreNLP PIPELINE -
COMPARATIVETAG
- See Also:
- Constant Field Values
-
SUPERLATIVETAG
- See Also:
- Constant Field Values
-
-
Constructor Details
-
ComparisonUtils
public ComparisonUtils()
-
-
Method Details
-
getProperties
Returns a list of properties for the given superlative or comparative (also works for the basic form of the supported adjectives). Supported adjectives can be found inComparisonEnum.- Parameters:
comparison- Adjective.- Returns:
- List of properties for the given adjective, null if the adjective is not supported.
-
getOrder
Returns the order for the given superlative or comparative which can then be used in SPARQL queries. Supported adjectives can be found inComparisonEnum.- Parameters:
comparison- A superlative or comparative.- Returns:
- Order for the given superlative or comparative, null if it is not supported.
-
getComparatives
Retrieves comparatives from the string. CallsgetWords(String, String).- Parameters:
question- String to retrieve comparatives from.- Returns:
- List of the retrieved comparatives.
-
getSuperlatives
Retrieves superlatives from the string. CallsgetWords(String, String).- Parameters:
question- String to retrieve superlatives from.- Returns:
- List of the retrieved superlatives.
-
getWords
Retrieves a part of speech from the given string, depending on the parameter tag. JJR for comparatives and JJS for superlatives.- Parameters:
question- String to retrieve words from.tag- JJR for comparatives and JJS for superlatives.- Returns:
- List of the retrieved words.
-