20#ifndef INCLUDED_I18NPOOL_SOURCE_SEARCH_LEVDIS_HXX
21#define INCLUDED_I18NPOOL_SOURCE_SEARCH_LEVDIS_HXX
99 std::unique_ptr<sal_Unicode[]>
cp;
100 std::unique_ptr<bool[]>
bp;
114 std::unique_ptr<int[]>
p;
123 p.reset(
new int[ s<3 ? 3 : s ]);
150 static int Mid3(
int x,
int y,
int z );
161 int nLongerZ,
bool bRelaxed );
172 void CalcLPQR(
int nOtherX,
int nShorterY,
int nLongerZ,
189 for ( k=0; k < jj; k++ )
193 for ( k=0; k < ii; k++ )
194 if ( cString[k] == c )
201 for ( k=ii+1; k < nStringLen; k++ )
202 if ( cString[k] == c )
std::unique_ptr< int[]> p
WLevDisDistanceMem(size_t s)
"Safe" memory allocation in ctor
sal_Unicode * GetcPtr() const
std::unique_ptr< bool[]> bp
WLevDisPatternMem(sal_Int32 s)
std::unique_ptr< sal_Unicode[]> cp
Weighted Levenshtein Distance (WLD)
int levdisbalance(sal_Int32 jj, sal_Int32 ii, sal_Unicode c, const sal_Unicode *cString, sal_Int32 nStringLen) const
sal_Int32 nArrayLen
length of distance array
int nRepP0
replacement weigh
bool * bpPatIsWild
pointer to bool array whether pattern is wildcard
bool bSplitCount
if TRUE, Rep/Ins/Del are counted separately
WLevDisDistanceMem aDisMem
manage allocation of distance array
static int Mid3(int x, int y, int z)
middle value of 3 values
int nLimit
WLD limit replacements/insertions/deletions.
sal_Int32 nPatternLen
length of pattern
void InitData(const sal_Unicode *cPattern)
int WLD(const sal_Unicode *cString, sal_Int32 nStringLen)
Calculate the Weighted Levenshtein Distance from string to pattern.
WLevDisPatternMem aPatMem
manage allocation of pattern array
int nStars
count of '*' wildcards in pattern
int * npDistance
pointer to distance array
sal_Unicode * cpPattern
pointer to pattern array
WLevDistance(const sal_Unicode *cPattern, int nOtherX, int nShorterY, int nLongerZ, bool bRelaxed)
CTor with user input.
int nInsQ0
insertion weigh
void CalcLPQR(int nOtherX, int nShorterY, int nLongerZ, bool bRelaxed)
Calculate the internal weighs corresponding to the user input values.