diff options
author | Patrick Simianer <p@simianer.de> | 2013-05-02 09:09:59 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2013-05-02 09:09:59 +0200 |
commit | 9e50f0237413180fba11b500c9dce5c600e3c157 (patch) | |
tree | 556fc31d231353c853a864afffddd43dc525549a /extractor/matchings_finder.h | |
parent | d18024a41cbc1b54db88d499571349a6234b6db8 (diff) | |
parent | 14ed53426726202813a8e82d706b44266f015fe1 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'extractor/matchings_finder.h')
-rw-r--r-- | extractor/matchings_finder.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/extractor/matchings_finder.h b/extractor/matchings_finder.h new file mode 100644 index 00000000..451f4a4c --- /dev/null +++ b/extractor/matchings_finder.h @@ -0,0 +1,37 @@ +#ifndef _MATCHINGS_FINDER_H_ +#define _MATCHINGS_FINDER_H_ + +#include <memory> +#include <string> + +using namespace std; + +namespace extractor { + +class PhraseLocation; +class SuffixArray; + +/** + * Class wrapping the suffix array lookup for a contiguous phrase. + */ +class MatchingsFinder { + public: + MatchingsFinder(shared_ptr<SuffixArray> suffix_array); + + virtual ~MatchingsFinder(); + + // Uses the suffix array to search only for the last word of the phrase + // starting from the range in which the prefix of the phrase occurs. + virtual PhraseLocation Find(PhraseLocation& location, const string& word, + int offset); + + protected: + MatchingsFinder(); + + private: + shared_ptr<SuffixArray> suffix_array; +}; + +} // namespace extractor + +#endif |