Hello.
When a user writes a string, for example "spagetti" or "spag" or "spaget" or something like that, i want to recognize the string and put on its place other string, like "pasta" and use the latest string in a query in a database.
I hope i didn't confuse you.
Thank you!
String correlation
Moderator: General Moderators
Re: String correlation
I may be mistaken, but I don't believe that's possible...
You'd have to make a table or something of correlation. Say, have a field for word match, and then for match value.
Then you can use LIKE with wild cards in the query, to select words that have a correlation, and use that word in the new query instead.
For example:
the table:
Say the word is "spag", do:
Then `Word Value` should contain "pasta". If you were to get a bit more advanced, I guess you could have a ranking system, so that if multiple matches are found, you can decide which one is most like what the user meant in context.
You'd have to make a table or something of correlation. Say, have a field for word match, and then for match value.
Then you can use LIKE with wild cards in the query, to select words that have a correlation, and use that word in the new query instead.
For example:
the table:
Code: Select all
| Word Match| Word Value |
| | |
| spaghetti | pasta |
Code: Select all
SELECT `Word Value` FROM TABLE WHERE `Word Match` LIKE '%spag%'Re: String correlation
Thank you very much jackpf for your helpful advice!
Re: String correlation
Sorry, I edited my post to give an example. I wasn't sure if you saw it...I just thought I'd let you know.
Anyway, yeah, no problem. Good luck!
Anyway, yeah, no problem. Good luck!
Re: String correlation
Yes, i saw itjackpf wrote:Sorry, I edited my post to give an example. I wasn't sure if you saw it...I just thought I'd let you know.
Anyway, yeah, no problem. Good luck!
Thank very much once again! I appreciate it!