I need help to find (almost matching) records (1 Viewer)

Randy1

New member
Local time
Today, 23:48
Joined
Mar 19, 2023
Messages
2
Im trying to build a rhyme tool for a language which is "orthographic" (This means that the way a word is spelled corresponds directly to its pronunciation)
I already have a database of many words of my language. and I have found a way to separate each word into it's individual letters. (sounds)
so in my database, each word is written like this:
FieldWord: Word
Field1: W
Field2: o
Field3: r
Field4: d

The purpose of this database will be to have a search field which brings up rhyming words. But not just simple rhymes.
I want to write for example (Manage) and the database brings up (Carnage).
The letters a,n,a,g,e match but they are in different positions in the word
for manage, ( n ) is the 3rd letter. but for Carnage, ( n ) is the 4th letter.

My issue is that I can't find a way to bring up all words that are similar in SOME fields.
they can't be completely the same. but they can't be just matching in 1 letter neither.

Does anyone know how I can achieve this? Many thanks :)
 

theDBguy

I’m here to help
Staff member
Local time
Today, 13:48
Joined
Oct 29, 2018
Messages
21,474
Hi. Welcome to AWF!

First thing I would try is "normalize" your table to store the letters in a child table. Maybe that would help solve your problem.
 

Randy1

New member
Local time
Today, 23:48
Joined
Mar 19, 2023
Messages
2
Hi. Welcome to AWF!

First thing I would try is "normalize" your table to store the letters in a child table. Maybe that would help solve your problem.
Thank you very much ^^

I don't see how creating a child table would help. can you explain please?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 15:48
Joined
Feb 28, 2001
Messages
27,188
You might have to look into making a unicode DB in which your orthographic letters are assigned to specific unicode characters. Which, based on the way you describe it, would be phonemes. For discussion, I will use {} to enclose a phoneme but I won't use the international phonetic alphabet because off-hand I don't have a decent reference and at this time of night, I'm too lazy to do the right web search.

It might be possible to use the LIKE (comparison) operator to approach this problem so that you could match wildcard pattern * {AH} {DJ} to get {GH (hard G)}{AH}{R}{AH}{DJ} and {HH (breathy H)}{OH}{M}{AH}{DJ} = garage and homage, which would rhyme.

The next step would be trickier because if you want to allow imperfect matches, you would have to come up with weight-based scoring depending on how close you want the rhyme to be. In THAT case, you will need to have a forward-reading comparison scheme and a backward-reading comparison scheme and a matrix of whether you could count two letters (e.g. {GH} and {DJ}, hard and soft G) as matching, and if so, how close.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:48
Joined
May 7, 2009
Messages
19,245
sample of Levenshtein fuzzy match (see form1).
 

Attachments

  • dbSoundex.zip
    4.4 MB · Views: 63

ebs17

Well-known member
Local time
Today, 22:48
Joined
Feb 7, 2020
Messages
1,946
A very simple approach, related to letters and equality of letters:
SQL:
SELECT
   T1.Word,
   T2.Word AS X
FROM
   YourTable AS T1,
   YourTable AS T2,
   (
      SELECT
         I
      FROM
         T999
      WHERE
         I BETWEEN 3 AND 10
   ) AS T
WHERE
   T1.Word LIKE "*" & Right(T2.Word, T.I)

T999 is a table with a column I containing the numbers from 0 to 999 (my standard number help table).
 
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Today, 16:48
Joined
Feb 19, 2002
Messages
43,281
For rhyming, you care about the word ending. So match from the back to the front.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 16:48
Joined
May 21, 2018
Messages
8,529
 

Users who are viewing this thread

Top Bottom