public class TripleConverter extends Object
| Modifier and Type | Field and Description |
|---|---|
private boolean |
considerLiteralLanguage |
private static String |
DEFAULT_CACHE_BASE_DIR |
private static String |
DEFAULT_CACHE_DIR |
private boolean |
determinePluralForm |
private boolean |
encapsulateStringLiterals |
private GenderDetector |
genderDetector |
private LiteralConverter |
literalConverter |
private static org.slf4j.Logger |
logger |
private simplenlg.framework.NLGFactory |
nlgFactory |
private PropertyVerbalizer |
pp |
private simplenlg.realiser.english.Realiser |
realiser |
private org.dllearner.reasoning.SPARQLReasoner |
reasoner |
private boolean |
returnAsSentence |
private IRIConverter |
uriConverter |
private boolean |
useAsWellAsCoordination |
private boolean |
useGenderInformation |
| Constructor and Description |
|---|
TripleConverter() |
TripleConverter(org.aksw.jena_sparql_api.core.QueryExecutionFactory qef,
IRIConverter uriConverter,
String cacheDirectory,
net.sf.extjwnl.dictionary.Dictionary wordnetDirectory) |
TripleConverter(org.aksw.jena_sparql_api.core.QueryExecutionFactory qef,
PropertyVerbalizer propertyVerbalizer,
IRIConverter uriConverter,
String cacheDirectory,
net.sf.extjwnl.dictionary.Dictionary wordnetDirectory,
simplenlg.lexicon.Lexicon lexicon) |
TripleConverter(org.aksw.jena_sparql_api.core.QueryExecutionFactory qef,
String cacheDirectory,
net.sf.extjwnl.dictionary.Dictionary wordnetDirectory) |
TripleConverter(org.aksw.jena_sparql_api.core.QueryExecutionFactory qef,
String cacheDirectory,
simplenlg.lexicon.Lexicon lexicon) |
TripleConverter(org.dllearner.kb.sparql.SparqlEndpoint endpoint) |
TripleConverter(org.dllearner.kb.sparql.SparqlEndpoint endpoint,
String cacheDirectory) |
TripleConverter(org.dllearner.kb.sparql.SparqlEndpoint endpoint,
String cacheDirectory,
net.sf.extjwnl.dictionary.Dictionary wordnetDirectory) |
TripleConverter(org.dllearner.kb.sparql.SparqlEndpoint endpoint,
String cacheDirectory,
net.sf.extjwnl.dictionary.Dictionary wordnetDirectory,
simplenlg.lexicon.Lexicon lexicon) |
| Modifier and Type | Method and Description |
|---|---|
private void |
asPronoun(simplenlg.framework.NLGElement el) |
String |
convert(List<org.apache.jena.graph.Triple> triples)
Return a textual representation for the given triples.
|
String |
convert(org.apache.jena.graph.Triple t)
Return a textual representation for the given triple.
|
String |
convert(org.apache.jena.graph.Triple t,
boolean negated)
Return a textual representation for the given triple.
|
simplenlg.phrasespec.SPhraseSpec |
convertToPhrase(org.apache.jena.graph.Triple t)
Convert a triple into a phrase object
|
simplenlg.phrasespec.SPhraseSpec |
convertToPhrase(org.apache.jena.graph.Triple t,
boolean negated)
Convert a triple into a phrase object
|
simplenlg.phrasespec.SPhraseSpec |
convertToPhrase(org.apache.jena.graph.Triple t,
boolean negated,
boolean reverse)
Convert a triple into a phrase object
|
List<simplenlg.phrasespec.SPhraseSpec> |
convertToPhrases(Collection<org.apache.jena.graph.Triple> triples)
Converts a collection of triples into a list of phrases.
|
simplenlg.phrasespec.NPPhraseSpec |
getNPPhrase(String uri,
boolean plural,
boolean isClass)
Takes a URI and returns a noun phrase for it
|
simplenlg.phrasespec.NPPhraseSpec |
processClassNode(org.apache.jena.graph.Node node,
boolean plural)
Converts the node that is supposed to represent a class in the knowledge
base into an NL phrase.
|
simplenlg.phrasespec.NPPhraseSpec |
processLiteralNode(org.apache.jena.graph.Node node) |
simplenlg.framework.NLGElement |
processNode(org.apache.jena.graph.Node node)
Process the node and return an NLG element that contains the textual
representation.
|
private simplenlg.phrasespec.NPPhraseSpec |
processObject(org.apache.jena.graph.Node object,
boolean isClass) |
simplenlg.phrasespec.NPPhraseSpec |
processResourceNode(org.apache.jena.graph.Node node) |
private simplenlg.framework.NLGElement |
processSubject(org.apache.jena.graph.Node subject) |
simplenlg.phrasespec.NPPhraseSpec |
processVarNode(org.apache.jena.graph.Node varNode) |
void |
setConsiderLiteralLanguage(boolean considerLiteralLanguage) |
void |
setDeterminePluralForm(boolean determinePluralForm) |
void |
setEncapsulateStringLiterals(boolean encapsulateStringLiterals)
Whether to encapsulate the value of string literals in "".
|
void |
setGenderDetector(GenderDetector genderDetector) |
void |
setReturnAsSentence(boolean returnAsSentence) |
void |
setUseGenderInformation(boolean useGenderInformation) |
private boolean |
usePluralForm(org.apache.jena.graph.Triple triple) |
private static final org.slf4j.Logger logger
private static String DEFAULT_CACHE_BASE_DIR
private static String DEFAULT_CACHE_DIR
private simplenlg.framework.NLGFactory nlgFactory
private simplenlg.realiser.english.Realiser realiser
private IRIConverter uriConverter
private LiteralConverter literalConverter
private PropertyVerbalizer pp
private org.dllearner.reasoning.SPARQLReasoner reasoner
private boolean determinePluralForm
private boolean considerLiteralLanguage
private boolean encapsulateStringLiterals
private boolean useAsWellAsCoordination
private boolean returnAsSentence
private boolean useGenderInformation
private GenderDetector genderDetector
public TripleConverter()
public TripleConverter(org.dllearner.kb.sparql.SparqlEndpoint endpoint)
public TripleConverter(org.aksw.jena_sparql_api.core.QueryExecutionFactory qef,
String cacheDirectory,
net.sf.extjwnl.dictionary.Dictionary wordnetDirectory)
public TripleConverter(org.dllearner.kb.sparql.SparqlEndpoint endpoint,
String cacheDirectory)
public TripleConverter(org.dllearner.kb.sparql.SparqlEndpoint endpoint,
String cacheDirectory,
net.sf.extjwnl.dictionary.Dictionary wordnetDirectory)
public TripleConverter(org.dllearner.kb.sparql.SparqlEndpoint endpoint,
String cacheDirectory,
net.sf.extjwnl.dictionary.Dictionary wordnetDirectory,
simplenlg.lexicon.Lexicon lexicon)
public TripleConverter(org.aksw.jena_sparql_api.core.QueryExecutionFactory qef,
IRIConverter uriConverter,
String cacheDirectory,
net.sf.extjwnl.dictionary.Dictionary wordnetDirectory)
public TripleConverter(org.aksw.jena_sparql_api.core.QueryExecutionFactory qef,
String cacheDirectory,
simplenlg.lexicon.Lexicon lexicon)
public TripleConverter(org.aksw.jena_sparql_api.core.QueryExecutionFactory qef,
PropertyVerbalizer propertyVerbalizer,
IRIConverter uriConverter,
String cacheDirectory,
net.sf.extjwnl.dictionary.Dictionary wordnetDirectory,
simplenlg.lexicon.Lexicon lexicon)
public String convert(org.apache.jena.graph.Triple t)
t - the triple to convertpublic String convert(org.apache.jena.graph.Triple t, boolean negated)
t - the triple to convertnegated - if phrase is negatedpublic String convert(List<org.apache.jena.graph.Triple> triples)
triples - the triples to convertprivate void asPronoun(simplenlg.framework.NLGElement el)
public simplenlg.phrasespec.SPhraseSpec convertToPhrase(org.apache.jena.graph.Triple t)
t - the triplepublic simplenlg.phrasespec.SPhraseSpec convertToPhrase(org.apache.jena.graph.Triple t,
boolean negated)
t - the triplepublic simplenlg.phrasespec.SPhraseSpec convertToPhrase(org.apache.jena.graph.Triple t,
boolean negated,
boolean reverse)
t - the triplenegated - if phrase is negatedreverse - whether subject and object should be changed during
verbalizationpublic List<simplenlg.phrasespec.SPhraseSpec> convertToPhrases(Collection<org.apache.jena.graph.Triple> triples)
triples - the triplespublic void setEncapsulateStringLiterals(boolean encapsulateStringLiterals)
LiteralConverter.setEncapsulateStringLiterals(boolean)encapsulateStringLiterals - TRUE if string has to be wrapped in "", otherwise FALSEpublic void setDeterminePluralForm(boolean determinePluralForm)
determinePluralForm - the determinePluralForm to setpublic void setConsiderLiteralLanguage(boolean considerLiteralLanguage)
considerLiteralLanguage - the considerLiteralLanguage to setprivate boolean usePluralForm(org.apache.jena.graph.Triple triple)
public void setReturnAsSentence(boolean returnAsSentence)
returnAsSentence - whether the style of the returned result is a proper English
sentence or just a phrasepublic void setUseGenderInformation(boolean useGenderInformation)
useGenderInformation - whether to use the gender information about a resourcepublic void setGenderDetector(GenderDetector genderDetector)
public simplenlg.framework.NLGElement processNode(org.apache.jena.graph.Node node)
node - the node to processpublic simplenlg.phrasespec.NPPhraseSpec processClassNode(org.apache.jena.graph.Node node,
boolean plural)
node - the nodeplural - whether the plural form should be usedpublic simplenlg.phrasespec.NPPhraseSpec processVarNode(org.apache.jena.graph.Node varNode)
public simplenlg.phrasespec.NPPhraseSpec processLiteralNode(org.apache.jena.graph.Node node)
public simplenlg.phrasespec.NPPhraseSpec processResourceNode(org.apache.jena.graph.Node node)
private simplenlg.framework.NLGElement processSubject(org.apache.jena.graph.Node subject)
private simplenlg.phrasespec.NPPhraseSpec processObject(org.apache.jena.graph.Node object,
boolean isClass)
public simplenlg.phrasespec.NPPhraseSpec getNPPhrase(String uri, boolean plural, boolean isClass)
uri - the URI to convertplural - whether it is in plural formisClass - if URI is supposed to be a classCopyright © 2020. All rights reserved.