info.ephyra.answerselection.filters
Class CacheResultsFilter
java.lang.Object
info.ephyra.answerselection.filters.Filter
info.ephyra.answerselection.filters.CacheResultsFilter
public class CacheResultsFilter
- extends Filter
Caches the results along with the query string of the first result. If the
query string is the same in a subsequent call, the cached results are
returned, otherwise the cache is updated.
This class extends the class Filter.
- Version:
- 2008-02-10
- Author:
- Guido Sautter, Nico Schlaefer
|
Method Summary |
Result[] |
apply(Result[] results)
Resets the result array to a previous state if the query string matches. |
private void |
cache(java.lang.String query,
Result[] results)
|
private Result[] |
cacheLookup(java.lang.String query)
|
| Methods inherited from class info.ephyra.answerselection.filters.Filter |
apply |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
lastQuery
private java.lang.String lastQuery
lastQueryResults
private Result[] lastQueryResults
CacheResultsFilter
public CacheResultsFilter()
apply
public Result[] apply(Result[] results)
- Resets the result array to a previous state if the query string matches.
- Overrides:
apply in class Filter
- Parameters:
results - array of Result objects
- Returns:
- modified array of
Result objects
cache
private void cache(java.lang.String query,
Result[] results)
cacheLookup
private Result[] cacheLookup(java.lang.String query)