In order to make Levensthein distance (string similary) work with Sqlite on Windows, I either:
need to find a Sqlite binary version that has
spellfix1
module already includedor to recompile the whole Sqlite for Windows with this module,
- or to compile just this module.
The final goal is to load it in Python via:
import sqlite3
db = sqlite3.connect(':memory:')
db.enable_load_extension(True)
db.load_extension('./spellfix')
db.enable_load_extension(False)
...
c.execute('SELECT * FROM mytable WHERE editdist3(description, "Hello wrld") < 3')
Question:
Should I recompile the whole Sqlite for Windows, and replace C:\Python27\DLLs\_sqlite3.pyd
by the new one? If so, how? and is it safe to expect that Python will accept this newly-compiled _sqlite3.pyd
file?
Or should I keep the old C:\Python27\DLLs\_sqlite3.pyd
and just compile the external module spellfix1
? How?
What I've tried so far:
- Download https://sqlite.org/2016/sqlite-src-3110100.zip, unzip it
Run this:
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" cl ext\misc\spellfix.c
ext\misc\spellfix.c(17) : fatal error C1083: Cannot open include file: 'sqlite3ext.h': No such file or directory
Where to find the headers, and where to specify these headers in
cl.exe ...
?
Note: this is for Linux but I couldn't do the same on Windows.