Soundex

From the sqlite web site:sqlite.org

soundex(X) The soundex(X) function returns a string that is the soundex encoding of the string X. The string "?000" is returned if the argument is NULL or contains no ASCII alphabetic characters. This function is omitted from SQLite by default. It is only available if the SQLITE_SOUNDEX compile-time option is used when SQLite is built.

I undertood the soundex method to be for compairing names for similarities … Brian vs Bryan vs Brien …

What i’m trying to wrap my noodle around is how can i use this sqlite ‘method’ (?) from Xojo
db.SQLExecute(???) . Sounds like sqlite implementations may or may not have it based on compile time options.

SELECT * FROM table where SOUNDEX(“BRIAN”)=SOUNDEX(namefield)

however bear in mind… SOUNDEX is a VERY VERY Loose comparison… it reduces any word to 4 characters a Letter and 3 digits

I’m curious about the comment that this may work depending on how sqlite was compiled.
Who has control over that? Xojo or my Operating System?

Can i use it to compare two Xojo strings without a database?

https://blog.xojo.com/2017/05/12/soundex-algorithm/

And honestly… it is not worth wasting you time with…

That’s really helpful thanks Dave.

Which it is not in our plugin.

Would it be too much to ask?

A feature request in Feedback would be helpful.

I’m not sure your requirements here, but perhaps Full Text Search is something else you want to look at:
https://documentation.xojo.com/topics/databases/supported_engines/sqlite/full_text_searching.html

Dave mentioned the SoundEx blog post, for reference here’s the page in our docs:
https://documentation.xojo.com/topics/text_handling/searching_text_using_the_soundex_algorithm.html

Gotta love this forum!

Is Text as a class being deprecated?

I know this is an old post, but is SoundEx supported by Xojo’s SQLite database?

its not built in and doesnt appear to be enabled in the version included in 2019r1.1

I wish they would just build it with pretty much ever yoptional component as part of it even if that meant the plugin were a tad larger
ICU would be awesome

EDIT - quick test suggests its also not built in to the version in 2019r3.1

  Dim db As New SQLiteDatabase
  
  If db.Connect Then
    
    db.SQLExecute ( "create table foo ( bar ) ")
    
    db.SQLExecute("insert into foo(bar) values('abc')")
    db.SQLExecute("insert into foo(bar) values('123')")
    
    Dim rs As recordset = db.SQLSelect("select bar, soundex(bar) from foo")
    If db.Error Then
      Break // you hit this break point & inspecting the error message reveals an "unknown function" error
    End If
  End If
  

Please remember, soundEx only works well in English language. It’s not useable in German. We have another phonetic logic called “Kölner Phonetik” (see Wikipedia). A decade ago I have implemented this in Xojo and this works pretty good.

Metaphone is better than soundex - but again has certain language biases like soundex does

I’m pretty sure there are Xojo implementations in some toolkits that are freely available

SoundEx is already available in a variety of SQL databases. I would like to see Xojo at least provide this functionality (since it’s already there) for those who prefer to use it. :slight_smile:

its literally something they could already compile in IF they set the right compilation flags
many other options are as well including ICU
see Compile-time Options

EDIT : seems someone already asked for this :slight_smile:
<https://xojo.com/issue/48028>
<https://xojo.com/issue/38161>

[quote=478751:@Norman Palardy]
EDIT : seems someone already asked for this :slight_smile:
<https://xojo.com/issue/48028>
<https://xojo.com/issue/38161>[/quote]

Which Norman, Norman? :wink:

looks like that other imposter :stuck_out_tongue:

it boils any name/word or phrase down to a single Letter and 3 digit number, meaning that supposedly the entire “English” language would be represented by 26,000 unique code.

While working in the healthcare industry we needed to find ways to lookup similar sounding patient names, Soundex was an utter failure in terms of accuracy