Recent

Author Topic: sqlite + spellfix  (Read 770 times)

Espectr0

  • Full Member
  • ***
  • Posts: 218
sqlite + spellfix
« on: May 22, 2022, 06:23:33 pm »
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  [Select][+][-]
  1. sqlite3.ExecuteDirect('create table dictionary (original text, translated text)');
  2.  

insert some texts:

Code: Pascal  [Select][+][-]
  1. sqlite3.ExecuteDirect('insert into dictionary(original, translated) values ("similarity", "semejanza"), ("search", "busqueda"), ("is", "es"), ("awesome", "asombrosa"), ("awesomes", "asombrosas");');
  2.  

and query like:

Code: Pascal  [Select][+][-]
  1. 'select original, translated from dictionary where editdist3(original, "awesoem") < 600'
  2.  

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

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: sqlite + spellfix
« Reply #1 on: June 03, 2022, 04:56:09 am »
* I only get "awesome" result and not "awesomes", why?
Educated guess, this:
Code: SQL  [Select][+][-]
  1. editdist3(original, "awesoem") < 600
is not fulfilled for what particular word.
* Can I get what distance value the search had for each result?
Basic SQL:
Code: SQL  [Select][+][-]
  1. SELECT original, editdist3(original, "awesoem") FROM dictionary

 

TinyPortal © 2005-2018