gate.creole.annic
Interface Searcher

All Known Implementing Classes:
LuceneSearcher

public interface Searcher

Searcher interface.

Author:
niraj

Method Summary
 void exportResults(File outputFile)
          This method can be used for exporting results
 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()
          Returns the Map containing all possible values of AnnotationTypes and Feature Values for each of this annotationType.
 Hit[] getHits()
          return the last seen hits once again
 String[] getIndexedAnnotationSetNames()
          Returns an containing names of the indexed annotation sets * Each entry has the following format: corpusName;annotationSetName where, the corpusName is the name of the corpus the annotationSetName belongs to.
 Map<String,Object> getParameters()
          Returns the recently set parameters
 String getQuery()
          Query to search
 Hit[] next(int numberOfHits)
          Return the next numberOfHits -1 indicates all
 boolean search(String query, Map<String,Object> parameters)
          Search method that allows searching
 

Method Detail

search

boolean search(String query,
               Map<String,Object> parameters)
               throws SearchException
Search method that allows searching

Parameters:
query -
numberOfPatterns -
patternWindow -
Returns:
Throws:
SearchException

getQuery

String getQuery()
Query to search

Returns:

next

Hit[] next(int numberOfHits)
           throws SearchException
Return the next numberOfHits -1 indicates all

Returns:
Throws:
SearchException

getAnnotationTypesMap

Map<String,List<String>> getAnnotationTypesMap()
Returns the Map containing all possible values of AnnotationTypes and Feature Values for each of this annotationType. This call must only be invoked after a call to the getIndexedAnnotationSetNames(String indexLocation) method. Otherwise this method doesn't guranttee the correct results. The results obtained has the following format. Key: CorpusName;AnnotationSetName;AnnotationType Value: respective features

Returns:

getIndexedAnnotationSetNames

String[] getIndexedAnnotationSetNames()
                                      throws SearchException
Returns an containing names of the indexed annotation sets * Each entry has the following format:

corpusName;annotationSetName

where, the corpusName is the name of the corpus the annotationSetName belongs to.

Parameters:
indexLocation -
Returns:
Throws:
SearchException

getParameters

Map<String,Object> getParameters()
Returns the recently set parameters

Returns:

exportResults

void exportResults(File outputFile)
This method can be used for exporting results

Parameters:
outputFile -

getHits

Hit[] getHits()
return the last seen hits once again

Returns:

freq

int freq(String corpusToSearchIn,
         String annotationSetToSearchIn,
         String annotationType,
         String featureName,
         String value)
         throws SearchException
Throws:
SearchException
See Also:
StatsCalculator#freq(String, String, String, String, String)

freq

int freq(String corpusToSearchIn,
         String annotationSetToSearchIn,
         String annotationType)
         throws SearchException
Throws:
SearchException
See Also:
StatsCalculator#freq(String, String, String, String, String)

freq

int freq(String corpusToSearchIn,
         String annotationSetToSearchIn,
         String annotationType,
         String featureName)
         throws SearchException
Throws:
SearchException
See Also:
StatsCalculator#freq(String, String, String, String, String)

freq

int freq(List<Hit> patternsToSearchIn,
         String annotationType,
         String feature,
         String value,
         boolean inMatchedSpan,
         boolean inContext)
         throws SearchException
Throws:
SearchException
See Also:
StatsCalculator#freq(List, String, String, String, boolean, boolean)

freq

int freq(List<Hit> patternsToSearchIn,
         String annotationType,
         boolean inMatchedSpan,
         boolean inContext)
         throws SearchException
Throws:
SearchException
See Also:
StatsCalculator#freq(List, String, String, String, boolean, boolean)

freqForAllValues

Map<String,Integer> freqForAllValues(List<Hit> patternsToSearchIn,
                                     String annotationType,
                                     String feature,
                                     boolean inMatchedSpan,
                                     boolean inContext)
                                     throws SearchException
Throws:
SearchException
See Also:
StatsCalculator#freq(List, String, String, boolean, boolean)