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