Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
simtexth.h File Reference

(a5bb88c896170ec0c719c3a73ce932cb8d5205ca)

#include <QString>
#include <QList>
+ Include dependency graph for simtexth.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Candidate
 
struct  CoMatrix
 
class  StringSimilarityMatcher
 

Typedefs

typedef QList< CandidateCandidateList
 

Functions

bool operator== (const Candidate &c, const Candidate &d)
 
bool operator!= (const Candidate &c, const Candidate &d)
 
static int getSimilarityScore (const QString &str1, const QString &str2)
 
CandidateList similarTextHeuristicCandidates (const Translator *tor, const QString &text, int maxCandidates)
 

Variables

const int textSimilarityThreshold = 190
 

Typedef Documentation

◆ CandidateList

Definition at line 37 of file simtexth.h.

Function Documentation

◆ getSimilarityScore()

static int getSimilarityScore ( const QString & str1,
const QString & str2 )
inlinestatic

Checks how similar two strings are. The return value is the score, and a higher score is more similar than one with a low score. Linguist considers a score over 190 to be a good match.

See also
StringSimilarityMatcher

Definition at line 77 of file simtexth.h.

◆ operator!=()

bool operator!= ( const Candidate & c,
const Candidate & d )
inline

Definition at line 33 of file simtexth.h.

References operator==().

+ Here is the call graph for this function:

◆ operator==()

bool operator== ( const Candidate & c,
const Candidate & d )
inline

Definition at line 29 of file simtexth.h.

Referenced by operator!=().

+ Here is the caller graph for this function:

◆ similarTextHeuristicCandidates()

CandidateList similarTextHeuristicCandidates ( const Translator * tor,
const QString & text,
int maxCandidates )

Definition at line 161 of file simtexth.cpp.

Variable Documentation

◆ textSimilarityThreshold

const int textSimilarityThreshold = 190

Definition at line 7 of file simtexth.h.

Referenced by similarTextHeuristicCandidates().