public class SimpleEntityCandidatesTrie extends Object implements EntityCandidatesTrie
Constructor and Description |
---|
SimpleEntityCandidatesTrie(EntityTextRetriever entityTextRetriever,
org.semanticweb.owlapi.model.OWLOntology ontology)
Initialize the trie with strings from the provided ontology and use the given entity name generator
for generating alternative words.
|
Modifier and Type | Method and Description |
---|---|
void |
addEntry(List<Token> s,
org.semanticweb.owlapi.model.OWLEntity e)
Adds an entity to the set of candidates of a string
|
void |
addEntry(List<Token> s,
org.semanticweb.owlapi.model.OWLEntity e,
List<Token> originalTokens) |
void |
buildTrie(org.semanticweb.owlapi.model.OWLOntology ontology) |
Set<EntityScorePair> |
getCandidateEntities(List<Token> tokens)
Gets set of candidate entities for a list of tokens
|
List<Token> |
getGeneratingStringForLongestMatch(List<Token> tokens)
Returns the string on which this entry is based on.
|
List<Token> |
getLongestMatchingText(List<Token> tokens)
Gets the longest matching string
|
static void |
main(String[] args) |
void |
printTrie() |
String |
toString() |
public SimpleEntityCandidatesTrie(EntityTextRetriever entityTextRetriever, org.semanticweb.owlapi.model.OWLOntology ontology)
entityTextRetriever
- the text retriever to useontology
- the ontology to get strings frompublic void buildTrie(org.semanticweb.owlapi.model.OWLOntology ontology)
public void addEntry(List<Token> s, org.semanticweb.owlapi.model.OWLEntity e)
EntityCandidatesTrie
addEntry
in interface EntityCandidatesTrie
public void addEntry(List<Token> s, org.semanticweb.owlapi.model.OWLEntity e, List<Token> originalTokens)
public Set<EntityScorePair> getCandidateEntities(List<Token> tokens)
EntityCandidatesTrie
getCandidateEntities
in interface EntityCandidatesTrie
public List<Token> getGeneratingStringForLongestMatch(List<Token> tokens)
EntityCandidatesTrie
getGeneratingStringForLongestMatch
in interface EntityCandidatesTrie
public List<Token> getLongestMatchingText(List<Token> tokens)
EntityCandidatesTrie
getLongestMatchingText
in interface EntityCandidatesTrie
public void printTrie()
DL-Learner is licenced under the terms of the GNU General Public License.
Copyright © 2007-2019 Jens Lehmann