Fuzzy Oracle text string search

Tags:
Oracle
When searching a string I need to fetch all the words present in the database from that string. e.g. " Today is very hot day", if I am having (Today/very/very hot/day/etc..) in my database, so this should fetch all the related results to that string.
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • carlosdl
    It is not very clear what you want to do.

    Can you post an example of the data that you would have stored in the table, and the exact results you would want to get if you run the query you are trying to build?
    84,580 pointsBadges:
    report
  • shubhanshusriv

    Hi

    My requirement is to spell check the words in a phrase and display the nearest match for all the words in a phrase.

    please find the sample query below :-

    'Thanks for the dinner last night'

    Select name from some_table where contains(name,'Thnx for the paty lat nigt') >0. this should search for all the misspelled words in the database.

     

    Regards,

    Shubh

    15 pointsBadges:
    report
  • carlosdl
    You could use the EDIT_INSTANCE_SIMILARITY function in the UTL_MATCH package.  It returns a number that tells you how close is one string to be the same as the other (0 means there is no match, and 100 means a perfect match).

    You would have to decide what number represents a good enough match for you.

    Here is an example:

       SELECT UTL_MATCH.EDIT_DISTANCE_SIMILARITY('Thnx for the paty lat nigt', 'Thanks for the dinner last night')
       FROM DUAL;
    This returns 66, and this ("thanks" not correctly spelled):

       SELECT UTL_MATCH.EDIT_DISTANCE_SIMILARITY('Thanks for the party lat nigt', 'Thanks for the dinner last night')
       FROM DUAL;


    Returns 75.
    84,580 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: