|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgate.creole.annic.lucene.LuceneSearcher
public class LuceneSearcher
This class provides the Searching functionality for annic.
| Field Summary | |
|---|---|
Map<String,List<String>> |
annotationTypesMap
Found annotation types in the annic patterns. |
| Constructor Summary | |
|---|---|
LuceneSearcher()
|
|
| Method Summary | |
|---|---|
void |
addQueryTokens(String query,
List<String> queryTokens)
Adds the query tokens for the given query. |
void |
exportResults(File outputFile)
This method allow exporting results in to the provided file. |
int |
freq(List<Hit> patternsToSearchIn,
String annotationType,
boolean inMatchedSpan,
boolean inContext)
|
int |
freq(List<Hit> patternsToSearchIn,
String annotationType,
String feature,
String value,
boolean inMatchedSpan,
boolean inContext)
|
int |
freq(String corpusToSearchIn,
String annotationSetToSearchIn,
String annotationType)
|
int |
freq(String corpusToSearchIn,
String annotationSetToSearchIn,
String annotationType,
String featureName)
|
int |
freq(String corpusToSearchIn,
String annotationSetToSearchIn,
String annotationType,
String featureName,
String value)
|
Map<String,Integer> |
freqForAllValues(List<Hit> patternsToSearchIn,
String annotationType,
String feature,
boolean inMatchedSpan,
boolean inContext)
|
Map<String,List<String>> |
getAnnotationTypesMap()
Gets the map of found annotation types and annotation features. |
Integer |
getContextWindow()
Gets the number of base token annotations to show in the context. |
Hit[] |
getHits()
Gets the found hits (annic patterns). |
String[] |
getIndexedAnnotationSetNames()
This method returns a set of annotation set names that are indexed. |
Map<String,Object> |
getParameters()
Gets the search parameters set by user. |
String |
getQuery()
Gets the submitted query. |
List<String> |
getQueryTokens(String query)
Gets the query tokens for the given query. |
Hit[] |
next(int numberOfHits)
Return the next numberOfHits -1 indicates all |
boolean |
search(String query,
Map<String,Object> parameters)
Method retunrs true/false indicating whether results were found or not. |
void |
setLuceneDatastore(LuceneDataStoreImpl datastore)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public Map<String,List<String>> annotationTypesMap
| Constructor Detail |
|---|
public LuceneSearcher()
| Method Detail |
|---|
public Hit[] next(int numberOfHits)
throws SearchException
next in interface SearcherSearchException
public boolean search(String query,
Map<String,Object> parameters)
throws SearchException
search in interface SearcherSearchExceptionpublic String getQuery()
getQuery in interface Searcherpublic Integer getContextWindow()
public Hit[] getHits()
getHits in interface Searcherpublic Map<String,List<String>> getAnnotationTypesMap()
getAnnotationTypesMap in interface Searcher
public String[] getIndexedAnnotationSetNames()
throws SearchException
corpusName;annotationSetName
where, the corpusName is the name of the corpus the annotationSetName belongs to.
getIndexedAnnotationSetNames in interface SearcherSearchExceptionpublic Map<String,Object> getParameters()
getParameters in interface Searcherpublic List<String> getQueryTokens(String query)
query -
public void addQueryTokens(String query,
List<String> queryTokens)
query - queryTokens - public void exportResults(File outputFile)
exportResults in interface Searcher
public int freq(String corpusToSearchIn,
String annotationSetToSearchIn,
String annotationType,
String featureName,
String value)
throws SearchException
freq in interface SearcherSearchExceptionStatsCalculator#freq(String, String, String, String, String)
public int freq(String corpusToSearchIn,
String annotationSetToSearchIn,
String annotationType)
throws SearchException
freq in interface SearcherSearchExceptionStatsCalculator#freq(String, String, String, String, String)
public int freq(String corpusToSearchIn,
String annotationSetToSearchIn,
String annotationType,
String featureName)
throws SearchException
freq in interface SearcherSearchExceptionStatsCalculator#freq(String, String, String, String, String)
public int freq(List<Hit> patternsToSearchIn,
String annotationType,
String feature,
String value,
boolean inMatchedSpan,
boolean inContext)
throws SearchException
freq in interface SearcherSearchExceptionStatsCalculator#freq(List, String, String, String, boolean, boolean)
public int freq(List<Hit> patternsToSearchIn,
String annotationType,
boolean inMatchedSpan,
boolean inContext)
throws SearchException
freq in interface SearcherSearchExceptionStatsCalculator#freq(List, String, String, String, boolean, boolean)
public Map<String,Integer> freqForAllValues(List<Hit> patternsToSearchIn,
String annotationType,
String feature,
boolean inMatchedSpan,
boolean inContext)
throws SearchException
freqForAllValues in interface SearcherSearchExceptionStatsCalculator#freq(List, String, String, boolean, boolean) public void setLuceneDatastore(LuceneDataStoreImpl datastore)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||