Approximate string matcher, treats strings as sentences composed of words. More...
#include <SUIT_SentenceMatcher.h>
Public Member Functions | |
| SUIT_SentenceMatcher () | |
| void | setUseExactWordOrder (bool theOn) |
| void | setUseFuzzyWords (bool theOn) |
| void | setCaseSensitive (bool theOn) |
| bool | isCaseSensitive () const |
| void | setQuery (QString theQuery) |
| const QString & | getQuery () const |
| double | match (const QString &theInputString) const |
| QString | toString () const |
| For debug. More... | |
Static Private Member Functions | |
| static bool | makePermutatedSentences (const QStringList &theWords, QList< QStringList > &theSentences) |
| static void | makeFuzzyWords (const QStringList &theWords, QStringList &theFuzzyWords) |
| static int | matchWithSentenceIgnoreEndings (const QString &theInputString, const QStringList &theSentence, bool theCaseSensitive) |
| static int | matchWithSentencesIgnoreEndings (const QString &theInputString, const QList< QStringList > &theSentences, bool theCaseSensitive) |
| static int | matchAtLeastOneWord (const QString &theInputString, const QStringList &theWords, bool theCaseSensitive) |
| static int | match (const QString &theInputString, const QStringList &theSentence, bool theCaseSensitive) |
| static int | match (const QString &theInputString, const QList< QStringList > &theSentences, bool theCaseSensitive) |
Private Attributes | |
| bool | myUseExactWordOrder |
| bool | myUseFuzzyWords |
| bool | myIsCaseSensitive |
| QString | myQuery |
| QStringList | myWords |
| QList< QStringList > | myPermutatedSentences |
| QStringList | myFuzzyWords |
| QList< QStringList > | myFuzzyPermutatedSentences |
Approximate string matcher, treats strings as sentences composed of words.
| SUIT_tools::SUIT_SentenceMatcher::SUIT_SentenceMatcher | ( | ) |
Default config: Exact word order = false; Fuzzy words = true; Case sensitive = false; Query = ""; // matches nothing.
References myIsCaseSensitive, myUseExactWordOrder, and myUseFuzzyWords.
|
inline |
|
inline |
|
staticprivate |
|
staticprivate |
| double SUIT_tools::SUIT_SentenceMatcher::match | ( | const QString & | theInputString | ) | const |
References myFuzzyPermutatedSentences, myFuzzyWords, myIsCaseSensitive, myPermutatedSentences, myQuery, myUseExactWordOrder, myUseFuzzyWords, and myWords.
|
staticprivate |
References matchAtLeastOneWord(), and matchWithSentencesIgnoreEndings().
|
staticprivate |
References matchAtLeastOneWord(), and matchWithSentenceIgnoreEndings().
|
staticprivate |
|
staticprivate |
|
staticprivate |
References matchWithSentenceIgnoreEndings().
| void SUIT_tools::SUIT_SentenceMatcher::setCaseSensitive | ( | bool | theOn | ) |
References myIsCaseSensitive.
| void SUIT_tools::SUIT_SentenceMatcher::setQuery | ( | QString | theQuery | ) |
| theQuery | should not be regex. |
References makeFuzzyWords(), makePermutatedSentences(), myFuzzyPermutatedSentences, myFuzzyWords, myPermutatedSentences, myQuery, myUseExactWordOrder, myUseFuzzyWords, and myWords.
| void SUIT_tools::SUIT_SentenceMatcher::setUseExactWordOrder | ( | bool | theOn | ) |
| void SUIT_tools::SUIT_SentenceMatcher::setUseFuzzyWords | ( | bool | theOn | ) |
| QString SUIT_tools::SUIT_SentenceMatcher::toString | ( | ) | const |
For debug.
References myFuzzyPermutatedSentences, myFuzzyWords, myIsCaseSensitive, myPermutatedSentences, myQuery, myUseExactWordOrder, myUseFuzzyWords, and myWords.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |