Concordia
ConcordiaSearcher Class Reference

#include <concordia_searcher.hpp>

Public Member Functions

virtual ~ConcordiaSearcher ()
 
void concordiaSearch (boost::shared_ptr< ConcordiaSearchResult > result, 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::vector< INDEX_CHARACTER_TYPE > &pattern) throw (ConcordiaException)
 
std::vector< AnubisSearchResultanubisSearch (boost::shared_ptr< ConcordiaConfig > config, 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::vector< INDEX_CHARACTER_TYPE > &pattern) throw (ConcordiaException)
 
boost::shared_ptr< TmMatchesMap > getTmMatches (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::vector< INDEX_CHARACTER_TYPE > &pattern) throw (ConcordiaException)
 
std::vector< SubstringOccurencelcpSearch (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::vector< sauchar_t > &pattern, SUFFIX_MARKER_TYPE &length) throw (ConcordiaException)
 

Detailed Description

Class for searching using Concordia algorithm. All searches are performed on data structures passed to the methods of this class by smart pointers.

Constructor & Destructor Documentation

ConcordiaSearcher::~ConcordiaSearcher ( )
virtual

Destructor.

Member Function Documentation

std::vector< AnubisSearchResult > ConcordiaSearcher::anubisSearch ( boost::shared_ptr< ConcordiaConfig config,
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::vector< INDEX_CHARACTER_TYPE > &  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
configconcordia config object (to read the anubis threshold parameter)
Thashed index to search in
markersmarkers array for the needs of searching
SAsuffix array for the needs of searching
patternpattern to be searched in the index. This pattern needs to be hashed.
Returns
vector of results
Exceptions
ConcordiaException

Here is the call graph for this function:

void ConcordiaSearcher::concordiaSearch ( boost::shared_ptr< ConcordiaSearchResult result,
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::vector< INDEX_CHARACTER_TYPE > &  pattern 
)
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
resultvariable to store the result
Thashed index to search in
markersmarkers array for the needs of searching
SAsuffix array for the needs of searching
patternpattern to be searched in the index. This pattern needs to be hashed.
Exceptions
ConcordiaException

Here is the call graph for this function:

boost::shared_ptr< TmMatchesMap > ConcordiaSearcher::getTmMatches ( 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::vector< INDEX_CHARACTER_TYPE > &  pattern 
)
throw (ConcordiaException
)

Generates map of all examples in the index which have at least one word in common with the pattern. This method is internally used in anubisSearch and may perform slow.

Parameters
Thashed index to search in
markersmarkers array for the needs of searching
SAsuffix array for the needs of searching
patternpattern to be searched in the index. This pattern needs to be hashed.
Returns
generated map
Exceptions
ConcordiaException

Here is the call graph for this function:

std::vector< SubstringOccurence > ConcordiaSearcher::lcpSearch ( 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::vector< sauchar_t > &  pattern,
SUFFIX_MARKER_TYPE &  length 
)
throw (ConcordiaException
)

Looks for fragments in the index which have the longest common prefix with the pattern. This method return the list of locations of these longest fragments (as return value) and their length in the length parameter. There is a tight limit on the number of longest fragments (currently set to 3). This method is used in conordiaSearch.

Parameters
Thashed index to search in
markersmarkers array for the needs of searching
SAsuffix array for the needs of searching
patternpattern to be searched in the index. This pattern needs to be hashed.
lengththe returned length of the longest fragments
Returns
list of locations of the longest fragments
Exceptions
ConcordiaException

The documentation for this class was generated from the following files: