Package de.julielab.jules.ae.genemapping
Class LuceneCandidateRetrieval
- java.lang.Object
-
- de.julielab.jules.ae.genemapping.LuceneCandidateRetrieval
-
- All Implemented Interfaces:
CandidateRetrieval
public class LuceneCandidateRetrieval extends java.lang.Object implements CandidateRetrieval
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.LoggercandidateLogstatic intJAROWINKLER_SCORERstatic intLEVENSHTEIN_SCORERstatic java.lang.StringLOGGER_NAME_CANDIDATESstatic intLUCENE_SCORERstatic intMAXENT_SCORERstatic java.lang.StringMAXENT_SCORER_MODELdefault model for MaxEntScorerstatic java.lang.StringNAME_PRIO_DELIMITERstatic intSIMPLE_SCORERstatic intTFIDFstatic intTOKEN_JAROWINKLER_SCORER
-
Constructor Summary
Constructors Constructor Description LuceneCandidateRetrieval(GeneMappingConfiguration config)LuceneCandidateRetrieval(org.apache.lucene.search.IndexSearcher mentionIndexSearcher, Scorer scorer)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<SynHit>getCandidates(GeneMention geneMention)java.util.List<SynHit>getCandidates(GeneMention geneMention, java.lang.String organism)java.util.List<SynHit>getCandidates(GeneMention geneMention, java.util.Collection<java.lang.String> organisms)java.util.List<SynHit>getCandidates(java.lang.String originalSearchTerm)java.util.List<SynHit>getCandidates(java.lang.String geneMentionText, java.lang.String organism)java.util.List<SynHit>getCandidates(java.lang.String geneMentionText, java.util.Collection<java.lang.String> organism)java.util.List<SynHit>getIndexEntries(java.util.List<java.lang.String> ids)Retrieves the first index hit for each ID.org.apache.lucene.search.IndexSearchergetMentionIndexSearcher()TermNormalizergetNormalizer()java.util.List<java.lang.String>getPriorityNames(java.lang.String id, int priority)java.util.List<java.lang.String>getPriorityNames(java.util.List<java.lang.String> ids, int priority)ScorergetScorer()java.lang.StringgetScorerInfo()intgetScorerType()org.apache.lucene.search.spell.SpellCheckergetSpellingChecker()java.util.List<java.lang.String>getSynonyms(java.lang.String id)java.lang.StringmapGeneIdToTaxId(java.lang.String geneId)voidsetNormalizer(TermNormalizer normalizer)ScorersetScorerType(int type)
-
-
-
Field Detail
-
NAME_PRIO_DELIMITER
public static final java.lang.String NAME_PRIO_DELIMITER
- See Also:
- Constant Field Values
-
LOGGER_NAME_CANDIDATES
public static final java.lang.String LOGGER_NAME_CANDIDATES
- See Also:
- Constant Field Values
-
SIMPLE_SCORER
public static final int SIMPLE_SCORER
- See Also:
- Constant Field Values
-
TOKEN_JAROWINKLER_SCORER
public static final int TOKEN_JAROWINKLER_SCORER
- See Also:
- Constant Field Values
-
MAXENT_SCORER
public static final int MAXENT_SCORER
- See Also:
- Constant Field Values
-
JAROWINKLER_SCORER
public static final int JAROWINKLER_SCORER
- See Also:
- Constant Field Values
-
LEVENSHTEIN_SCORER
public static final int LEVENSHTEIN_SCORER
- See Also:
- Constant Field Values
-
TFIDF
public static final int TFIDF
- See Also:
- Constant Field Values
-
LUCENE_SCORER
public static final int LUCENE_SCORER
- See Also:
- Constant Field Values
-
MAXENT_SCORER_MODEL
public static final java.lang.String MAXENT_SCORER_MODEL
default model for MaxEntScorer- See Also:
- Constant Field Values
-
candidateLog
public static final org.slf4j.Logger candidateLog
-
-
Constructor Detail
-
LuceneCandidateRetrieval
@Deprecated public LuceneCandidateRetrieval(org.apache.lucene.search.IndexSearcher mentionIndexSearcher, Scorer scorer) throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
LuceneCandidateRetrieval
public LuceneCandidateRetrieval(GeneMappingConfiguration config) throws GeneMappingException
- Throws:
GeneMappingException
-
-
Method Detail
-
getNormalizer
public TermNormalizer getNormalizer()
-
setNormalizer
public void setNormalizer(TermNormalizer normalizer)
-
getScorer
public Scorer getScorer()
-
getMentionIndexSearcher
public org.apache.lucene.search.IndexSearcher getMentionIndexSearcher()
-
getSpellingChecker
public org.apache.lucene.search.spell.SpellChecker getSpellingChecker()
-
setScorerType
public Scorer setScorerType(int type) throws GeneMappingException
- Throws:
GeneMappingException
-
getScorerInfo
public java.lang.String getScorerInfo()
-
getScorerType
public int getScorerType()
-
getCandidates
public java.util.List<SynHit> getCandidates(java.lang.String originalSearchTerm) throws GeneCandidateRetrievalException
- Specified by:
getCandidatesin interfaceCandidateRetrieval- Throws:
GeneCandidateRetrievalException
-
getCandidates
public java.util.List<SynHit> getCandidates(GeneMention geneMention) throws GeneCandidateRetrievalException
- Specified by:
getCandidatesin interfaceCandidateRetrieval- Throws:
GeneCandidateRetrievalException
-
getCandidates
public java.util.List<SynHit> getCandidates(GeneMention geneMention, java.util.Collection<java.lang.String> organisms) throws GeneCandidateRetrievalException
- Specified by:
getCandidatesin interfaceCandidateRetrieval- Throws:
GeneCandidateRetrievalException
-
getCandidates
public java.util.List<SynHit> getCandidates(GeneMention geneMention, java.lang.String organism) throws GeneCandidateRetrievalException
- Specified by:
getCandidatesin interfaceCandidateRetrieval- Throws:
GeneCandidateRetrievalException
-
getCandidates
public java.util.List<SynHit> getCandidates(java.lang.String geneMentionText, java.lang.String organism) throws GeneCandidateRetrievalException
- Specified by:
getCandidatesin interfaceCandidateRetrieval- Throws:
GeneCandidateRetrievalException
-
getCandidates
public java.util.List<SynHit> getCandidates(java.lang.String geneMentionText, java.util.Collection<java.lang.String> organism) throws GeneCandidateRetrievalException
- Specified by:
getCandidatesin interfaceCandidateRetrieval- Throws:
GeneCandidateRetrievalException
-
mapGeneIdToTaxId
public java.lang.String mapGeneIdToTaxId(java.lang.String geneId) throws java.io.IOException- Specified by:
mapGeneIdToTaxIdin interfaceCandidateRetrieval- Throws:
java.io.IOException
-
getIndexEntries
public java.util.List<SynHit> getIndexEntries(java.util.List<java.lang.String> ids) throws java.io.IOException
Description copied from interface:CandidateRetrievalRetrieves the first index hit for each ID.- Specified by:
getIndexEntriesin interfaceCandidateRetrieval- Parameters:
ids- The gene IDs for which to retrieve a single index hit.- Returns:
- One index entry - or null - for each input ID.
- Throws:
java.io.IOException- If there is an issue reading the index.
-
getSynonyms
public java.util.List<java.lang.String> getSynonyms(java.lang.String id) throws java.io.IOException- Specified by:
getSynonymsin interfaceCandidateRetrieval- Throws:
java.io.IOException
-
getPriorityNames
public java.util.List<java.lang.String> getPriorityNames(java.lang.String id, int priority) throws java.io.IOException- Throws:
java.io.IOException
-
getPriorityNames
public java.util.List<java.lang.String> getPriorityNames(java.util.List<java.lang.String> ids, int priority) throws java.io.IOException- Throws:
java.io.IOException
-
-