#include <index_searcher.hpp>
|
| IndexSearcher () |
|
virtual | ~IndexSearcher () |
|
MatchedPatternFragment | simpleSearch (boost::shared_ptr< HashGenerator > hashGenerator, boost::shared_ptr< std::vector< sauchar_t > > T, boost::shared_ptr< std::vector< SUFFIX_MARKER_TYPE > > markers, boost::shared_ptr< std::vector< saidx_t > > SA, const std::string &pattern, bool byWhitespace=false) throw (ConcordiaException) |
|
MatchedPatternFragment | lexiconSearch (boost::shared_ptr< HashGenerator > hashGenerator, boost::shared_ptr< std::vector< sauchar_t > > T, boost::shared_ptr< std::vector< SUFFIX_MARKER_TYPE > > markers, boost::shared_ptr< std::vector< saidx_t > > SA, const std::string &pattern, bool byWhitespace=false) throw (ConcordiaException) |
|
std::vector< AnubisSearchResult > | anubisSearch (boost::shared_ptr< ConcordiaConfig > config, boost::shared_ptr< HashGenerator > hashGenerator, boost::shared_ptr< std::vector< sauchar_t > > T, boost::shared_ptr< std::vector< SUFFIX_MARKER_TYPE > > markers, boost::shared_ptr< std::vector< saidx_t > > SA, const std::string &pattern) throw (ConcordiaException) |
|
boost::shared_ptr< ConcordiaSearchResult > | concordiaSearch (boost::shared_ptr< HashGenerator > hashGenerator, boost::shared_ptr< std::vector< sauchar_t > > T, boost::shared_ptr< std::vector< SUFFIX_MARKER_TYPE > > markers, boost::shared_ptr< std::vector< saidx_t > > SA, const std::string &pattern, bool byWhitespace=false) throw (ConcordiaException) |
|
Class for searching the index with a sentence. In all searches the sentence is first hashed and then used as a query.
IndexSearcher performs the simpleSearch on its own, but uses a ConcordiaSearcher object to carry out concordiaSearch.
IndexSearcher::IndexSearcher |
( |
| ) |
|
|
explicit |
IndexSearcher::~IndexSearcher |
( |
| ) |
|
|
virtual |
std::vector< AnubisSearchResult > IndexSearcher::anubisSearch |
( |
boost::shared_ptr< ConcordiaConfig > |
config, |
|
|
boost::shared_ptr< HashGenerator > |
hashGenerator, |
|
|
boost::shared_ptr< std::vector< sauchar_t > > |
T, |
|
|
boost::shared_ptr< std::vector< SUFFIX_MARKER_TYPE > > |
markers, |
|
|
boost::shared_ptr< std::vector< saidx_t > > |
SA, |
|
|
const std::string & |
pattern |
|
) |
| |
throw | ( | ConcordiaException |
| ) | | |
- Deprecated:
- Finds the examples from the index, whose resemblance to the pattern is maximal. This method may perform very slow, try using concordiaSearch instead.
- Parameters
-
config | concordia config object (to read the anubis threshold parameter) |
hashGenerator | hash generator to be used to convert input sentence to a hash |
T | hashed index to search in |
markers | markers array for the needs of searching |
SA | suffix array for the needs of searching |
pattern | string pattern to be searched in the index. |
byWhitespace | whether to tokenize the pattern by white space |
- Returns
- vector of results
- Exceptions
-
boost::shared_ptr< ConcordiaSearchResult > IndexSearcher::concordiaSearch |
( |
boost::shared_ptr< HashGenerator > |
hashGenerator, |
|
|
boost::shared_ptr< std::vector< sauchar_t > > |
T, |
|
|
boost::shared_ptr< std::vector< SUFFIX_MARKER_TYPE > > |
markers, |
|
|
boost::shared_ptr< std::vector< saidx_t > > |
SA, |
|
|
const std::string & |
pattern, |
|
|
bool |
byWhitespace = false |
|
) |
| |
throw | ( | ConcordiaException |
| ) | | |
Performs concordia lookup on the RAM-based index. This is a unique library functionality, designed to facilitate Computer-Aided Translation. For more info see Concordia searching.
- Parameters
-
hashGenerator | hash generator to be used to convert input sentence to a hash |
T | hashed index to search in |
markers | markers array for the needs of searching |
SA | suffix array for the needs of searching |
pattern | pattern to be searched in the index. |
byWhitespace | whether to tokenize the pattern by white space |
- Returns
- result of the search
- Exceptions
-
MatchedPatternFragment IndexSearcher::lexiconSearch |
( |
boost::shared_ptr< HashGenerator > |
hashGenerator, |
|
|
boost::shared_ptr< std::vector< sauchar_t > > |
T, |
|
|
boost::shared_ptr< std::vector< SUFFIX_MARKER_TYPE > > |
markers, |
|
|
boost::shared_ptr< std::vector< saidx_t > > |
SA, |
|
|
const std::string & |
pattern, |
|
|
bool |
byWhitespace = false |
|
) |
| |
throw | ( | ConcordiaException |
| ) | | |
Performs a search useful for lexicons in the following scenario: Concordia gets fed by a lexicon (glossary) instead of a TM. The lexicon search performs as simple search - it requires the match to cover the whole pattern, but additionally the lexicon search requires that the match is the whole example source.
- Parameters
-
hashGenerator | hash generator to be used to convert input sentence to a hash |
T | hashed index to search in |
markers | markers array for the needs of searching |
SA | suffix array for the needs of searching |
pattern | string pattern to be searched in the index. |
- Returns
- matched pattern fragment, containing occurences of the pattern in the index
- Exceptions
-
MatchedPatternFragment IndexSearcher::simpleSearch |
( |
boost::shared_ptr< HashGenerator > |
hashGenerator, |
|
|
boost::shared_ptr< std::vector< sauchar_t > > |
T, |
|
|
boost::shared_ptr< std::vector< SUFFIX_MARKER_TYPE > > |
markers, |
|
|
boost::shared_ptr< std::vector< saidx_t > > |
SA, |
|
|
const std::string & |
pattern, |
|
|
bool |
byWhitespace = false |
|
) |
| |
throw | ( | ConcordiaException |
| ) | | |
Performs a simple substring lookup in RAM-based index. For more info see Simple substring lookup.
- Parameters
-
hashGenerator | hash generator to be used to convert input sentence to a hash |
T | hashed index to search in |
markers | markers array for the needs of searching |
SA | suffix array for the needs of searching |
pattern | string pattern to be searched in the index. |
- Returns
- matched pattern fragment, containing occurences of the pattern in the index
- Exceptions
-
The documentation for this class was generated from the following files:
- /home/rafalj/projects/concordia/concordia/concordia/index_searcher.hpp
- /home/rafalj/projects/concordia/concordia/concordia/index_searcher.cpp