Forum > Databases
sqlite + spellfix
(1/1)
Espectr0:
Hola Gente!
My app uses sqlite and spellfix extension,
I have the following code (do not paste everything to simplify) where I create a table that contains original and translated text:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---sqlite3.ExecuteDirect('create table dictionary (original text, translated text)');
insert some texts:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---sqlite3.ExecuteDirect('insert into dictionary(original, translated) values ("similarity", "semejanza"), ("search", "busqueda"), ("is", "es"), ("awesome", "asombrosa"), ("awesomes", "asombrosas");');
and query like:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---'select original, translated from dictionary where editdist3(original, "awesoem") < 600'
my questions:
* I only get "awesome" result and not "awesomes", why?
* Can I get what distance value the search had for each result?
Thanks!
Leledumbo:
--- Quote from: Espectr0 on May 22, 2022, 06:23:33 pm ---* I only get "awesome" result and not "awesomes", why?
--- End quote ---
Educated guess, this:
--- Code: SQL [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---editdist3(original, "awesoem") < 600is not fulfilled for what particular word.
--- Quote from: Espectr0 on May 22, 2022, 06:23:33 pm ---* Can I get what distance value the search had for each result?
--- End quote ---
Basic SQL:
--- Code: SQL [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---SELECT original, editdist3(original, "awesoem") FROM dictionary
Navigation
[0] Message Index