ifsnop / damlev Goto Github PK
View Code? Open in Web Editor NEWDamerau-Levenshtein Distance UDF for MySQL - Supports upper bounding for fast searching and UTF-8 case insensitive throught iconv.
License: Other
Damerau-Levenshtein Distance UDF for MySQL - Supports upper bounding for fast searching and UTF-8 case insensitive throught iconv.
License: Other
Hello,
Tks for the post.
I made everything, but when I run:
"select damlevlim('coche', 'coche', 5);""
I got the message:
"Can't initialize function 'damlevlim'; DAMLEVLIM() failed to change locale"
Do you know how I can fix it?
Tks
select damlevlim('абвг', 'абде', 10);
return 0 (must be 2)select damlevlim('абвг', 'абве', 10);
return 0 (must be 1)select damlevlim('абвг', 'абд', 10);
return 1 (must be 2)select damlevlim('абвг', 'де', 10);
return 2 (must be 4)All samples use rusisan chars in UTF-8. Mysql library compiled with locale 'ru_RU.utf8'.
As I see, it calculate different only in string length, and doesn't compare chars.
In sample 1: length 4, 2 chars are identical ('аб'), and 2 chars different.
In sample 2: length 4, 3 chars are identical ('абв'), and 1 char different.
In sample 3: length 4 left (3 right), 2 chars are identical ('аб'), and 2 left (3 right) chars different.
In sample 4: length 4 left (2 right), all chars not identical.
On Ubuntu LTS 14.04, I had a problem where the setlocale function was failing with EGAIN. I hacked in a quick loop to try upto 10 times, which worked ok.
Has anyone else seen this, or got a better fix?
I have tried to compile on maridadb 10 having problem with m_ctype.h
gcc -m64 -Wall -fPIC -I/usr/local/include/mysql -L/usr/lib/mysql -L/usr/local/lib/mysql -I/usr/include/mysql -lmysqlclient -DMYSQL_DYNAMIC_PLUGIN -DDEBUG_MYSQL=0 -pipe -O3 -shared -o lib/mysqldamlevlim.so ./src/damlevlim.c In file included from ./src/damlevlim.h:26:0, from ./src/damlevlim.c:16: /usr/include/mysql/my_global.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp] #warning This file should not be included by clients, include only <mysql.h> ^ In file included from ./src/damlevlim.h:27:0, from ./src/damlevlim.c:16: /usr/include/mysql/my_sys.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp] #warning This file should not be included by clients, include only <mysql.h> ^ In file included from ./src/damlevlim.c:16:0: ./src/damlevlim.h:30:21: fatal error: m_ctype.h: No such file or directory #include <m_ctype.h>
above is the complete compile out. Any helps would be appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.