Matching words

Hi all,
i have this table , i want to retrieve words that match my word that i used it for search not all characters should match i mean how can i match words without match end of words by 3 or 4 characters that in case of my word more that 5 characters
create table string_test (id number(9),words varchar2(50));
insert into string_test  values(1,'Egypt');
insert into string_test  values(2,'Egyption');
insert into string_test  values(3,'introduction');
insert into string_test  values(4,'introduce');
insert into string_test  values(5,'wellcome');
insert into string_test  values(6,'comeback');expected results:
if i search for "introduction"
the results should be
3-introduction
4-introducewhen i search for "Wellc"
5) results wellcome
rules:
when i search for word,i wanst to show all words that match my word by less number of  letters from end by 3 or 4
(this only if my words more than 4 characters).
regards                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Ayham wrote:
when i search for word,i wanst to show all words that match my word by less number of letters from end by 3 or 4
(this only if my words more than 4 characters).This is the first step on the path which will lead you to re-inventing Oracle Text. [url http://docs.oracle.com/cd/E11882_01/text.112/e24435/overview.htm#CCAPP9001]Find out more.
Cheers, APC

Similar Messages

  • Count occurrences of matched words

    All,
    Does anyone know the syntax or algorithm to count the occurrences of matched words that where compared from two separate columns or tables? Below is a simple example of the type of comparison I would like to perform. I found the function regexp_count, but it only works in 11g. Unfortunately, I have Oracle 10g. Any help would be greatly appreciated. Thanks
    i.e.
    drop table compare_matched_words;
    create table compare_matched_words (
    query_id number,
    query_string1 varchar2(80),
    query_string2 varchar2(80)
    insert into compare_matched_words values (1, 'oracle 255','oracle1 255');
    insert into compare_matched_words values (2, 'larry or ellison','larry or');
    insert into compare_matched_words values (3, 'oracle and text','and');
    insert into compare_matched_words values (4, 'market1 share','market share');
    insert into compare_matched_words values (5, 'larry or',' larry or ellison');
    insert into compare_matched_words values (6, 'oracle1 255','oracle 255');

    Issue is not in 11g. Before you can solve the task you need to split QUERY_STRING1 and QUERY_STRING2 into words and then compare words for same QUERY_ID. To split string into words use something like:
    select  query_id,
            regexp_substr(query_string1,'\w+',1,column_value) query_string1_word
      from  compare_matched_words t,
            table(
                  cast(
                       multiset(
                                select  level
                                  from  dual
                                  connect by level <= length(regexp_replace(regexp_replace(QUERY_STRING1,'\w+','A'),'[^A]'))
                               ) as sys.OdciNumberList
    SQL> /
               QUERY_ID QUERY_STRING1_WORD
                      1 oracle
                      1 255
                      2 larry
                      2 or
                      2 ellison
                      3 oracle
                      3 and
                      3 text
                      4 market1
                      4 share
                      5 larry
               QUERY_ID QUERY_STRING1_WORD
                      5 or
                      6 oracle1
                      6 255
    14 rows selected.
    SQL> Now:
    select  t1.query_id,
            t1.query_string1,
            t2.query_string2,
            count(*) matchin_word_count
      from  (
             select  query_id,
                     query_string1,
                     regexp_substr(query_string1,'\w+',1,column_value) query_string1_word
               from  compare_matched_words t,
                     table(
                           cast(
                                multiset(
                                         select  level
                                            from  dual
                                           connect by level <= length(regexp_replace(regexp_replace(query_string1,'\w+','A'),'[^A]'))
                                        ) as sys.OdciNumberList
            ) t1,
             select  query_id,
                     query_string2,
                     regexp_substr(query_string2,'\w+',1,column_value) query_string2_word
               from  compare_matched_words t,
                     table(
                           cast(
                                multiset(
                                         select  level
                                            from  dual
                                           connect by level <= length(regexp_replace(regexp_replace(query_string2,'\w+','A'),'[^A]'))
                                        ) as sys.OdciNumberList
            ) t2
      where t2.query_id = t1.query_id
        and t2.query_string2_word = t1.query_string1_word
      group by t1.query_id,
               t1.query_string1,
               t2.query_string2
      order by t1.query_id
               QUERY_ID QUERY_STRING1                  QUERY_STRING2                   MATCHIN_WORD_COUNT
                      1 oracle 255                     oracle1 255                                      1
                      2 larry or ellison               larry or                                         2
                      3 oracle and text                and                                              1
                      4 market1 share                  market share                                     1
                      5 larry or                        larry or ellison                                2
                      6 oracle1 255                    oracle 255                                       1
    6 rows selected.
    SQL> SY.

  • Returning Count of Matching Words Rather than Score

    I'm using the SCORE function that will return a number representing the relevance of the matching search result; however, what the users really want is a COUNT of the number of search results returned within the document. For a search on the word "cat" this would return the number of times the word "cat" appears in the document. Ideally, if the user searched for "(dog and cat) within sentence", the COUNT would be of the number of times both dog and cat occur within sentences in the document; however, it would be acceptable to count the number of matching words in the document individually.
    Does Oracle Text have any way to return this COUNT directly within the results Oracle Text query? I can use a CTX_DOC.MARKUP call to mark the document up and the count the instances of the markup strings, but that's going to be a lot slower than if Oracle supports this out-of-the-box on the original query syntax.

    Yes (in 10g onwards), you need to use a query template with <score algorithm="COUNT"/>
    See here:
    http://www.oracle.com/technology/products/text/x/10g_tech_overview.html#qry_cscore
    Though the example there is a bit confusing since it has algorithm="SCORE" - the option for normal scoring.

  • Why firefox4 stops typing in FIND when it finds any matching word of that incomplete word ?

    In previous Firefox version 3.x, whenever I search through 'Find', it used to allow me to type the whole word in Find, to search on the page but in Firefox 4, it instantly stop allowing to type, once it finds any matching word on the incomplete word typed in the find.

    Hey srjna,
    Re-indexing Spotlight may help in getting Finder to locate the files that it's not currently displaying when searching.
    Spotlight: How to re-index folders or volumes
    https://support.apple.com/en-us/HT201716
    Regards,
    Allen

  • The Firefox find function seems to have become CAPS or non-caps specific, so that typing a word in non-caps will not find matching words with one or more capital letter.

    The find function seems to have changed in Firefox. Before, when doing a (CTRL + F) find, the search was not CAPS-specific or non-caps-specific. In other words, if I typed in "firefox" (no caps), it would find the words "firefox", Firefox", or "FIREFOX", regardless of capitalization. Now, however, the find function will only match the exact same capitalization. This totally undermines the usefulness of the function, and is a major hassle. Please fix it.
    == This happened ==
    A few times a week
    == I noticed in in the last two or so weeks.

    I am having a similar problem. The following page has the word Dangerfield in several times. My browser will get to Dang and turns pink
    http://www.genuki.org.uk/big/eng/HEF/ProbateRecords/WillsD.html
    Is it my Browser or is there a problem with Mozilla?
    I have also noted on other Google searches the same problem. Te term is listed in the page but Ctl F will not find the term

  • SQL Injection and Java Regular Expression: How to match words?

    Dear friends,
    I am handling sql injection attack to our application with java regular expression. I used it to match that if there are malicious characters or key words injected into the parameter value.
    The denied characters and key words can be " ' ", " ; ", "insert", "delete" and so on. The expression I write is String pattern_str="('|;|insert|delete)+".
    I know it is not correct. It could not be used to only match the whole word insert or delete. Each character in the two words can be matched and it is not what I want. Do you have any idea to only match the whole word?
    Thanks,
    Ricky
    Edited by: Ricky Ru on 28/04/2011 02:29

    Avoid dynamic sql, avoid string concatenation and use bind variables and the risk is negligible.

  • Matching words on the content with the glossary and creating links

    Is it Possible?
    We have a glossary (a big list of complex words with their definitions). On a nightly (weekly? monthly?) basis, can all content on the site be reviewed. If a word was found in the content that matched any of the glossary definitions there would be a link automatically created that can link the content word to the glossary definition.
    if need more info let me know..
    Thanks in advance
    SP

    how is all this data stored?

  • How to use Class Pattern to find match word ?

    Hi All:
    Now I want find some words in a article . for example , I want to find a word ---"book" . For this purpose , I use java.util.regex.Pattern to do that . Following is my code
    String tmpStr = ".*?[\\W]+book[\\W]+.*?";                         
    Pattern p = Pattern.compile(tmpStr);
    Matcher m = p.matcher(testStr);                // assume testStr is the article
    while ( (m1.find()) ) {
             System.out.println("find");
    }                    However , this code only help me to find some like " book " , " book! " , " !book " . But I also want to find some like "book " or " book" , since there aren't space before book or no space after book . How can I correct my code to do that ?
    Thanks in advance

      String tmpStr = "\\bbook\\b";

  • Search Array of String for exact match words

    I need to create a search feature.
    There will be a textfield where the user will input a word or words.
    Then I need to check if the are any reference in the array of names.
    namesArray ["ocean in the sky", "cean on sky", "cean is white"];
    keywordsArray ["cean", "sky"];
    matchCounter = 0;
    If I input the word "cean" I dont want in my results "ocean in the sky", only "cean is sky".
    I have the following code:
    for (var j:int = 0; j < namesArray.length; ++j)
         var tempStr:String = namesArray[j];
         for (var k:int = 0; k < keywordsArray.length; ++k)
              if (tempStr.indexOf(arrayKeywords[k]) != -1)
                  matchCounter++;
         if(lengthKeywords == matchCounter)
              trace("yeahhh... there's a match!!");
         matchCounter = 0;
    Is there a better way? How can I do this?

    There are few things but the main problem is that "new RegExp()" needs double escapes ("\\")
                var namesArray:Array = ["ocean in the sky", "cean on sky", "cean is white"];
                var keywordsArray:Array = ["cean", "sky"];
                for (var j:int = 0; j < namesArray.length; j++){
                    var matchCounter:uint = 0;
                    var tempStr:String = namesArray[j];
                    for (var k:int = 0; k < keywordsArray.length; k++){     
                        var regExp:RegExp = new RegExp("(\\s+|^)" + keywordsArray[k] + "(\\s+|$)"); 
                        if (tempStr.search(regExp) > -1){
                            matchCounter++;
                    if(keywordsArray.length == matchCounter){
                        trace("\"" + namesArray[j] + "\" matched all the keywords");
    Traces:
    "cean on sky" matched all the keywords

  • Serching matched word in senetence

    Hi,
    How would you search exact match of the word (match whole word) in a sentence using Java regex package or any other way?
    Thanks & regards
    Madan

    Thanks for reply.
    I did that but it searches all the match found for that word. But, my requirement is little different.
    For ex. Seraching "some" in the sentence "some somehow twosome " should return only "some" as exact match not "somehow" or "twosome".

  • How can I search for partial matching words in various columns without needing to provide search text?

    I have a list of names in three columns - B2:B425, D2:406, & E2:30 where they were input by different people, so the names are worded differently. For example, I can have the name "Handler, Jones, & Wright" and someone else has the name
    listed as "Handler Corp." What I need is to find a formula or VBA macro code that can search through my list and notice the possible duplicates and highlight them. Since they are all different names, I cannot give it a unique "text" to
    search.
    I found a code posted in this forum from some time ago (for two columns) but it highlighted all these names that had no partial words in common. Perhaps you can look over the code below and modify it for me or provide me with another one? Please let me know
    if you need any further information to guide me. 
    Sub HighlightDups()
        Dim rg1 As Range, rg2 As Range, c As Range, d As Range
        Dim sTemp As String, sTempWords() As String, sTempDWords() As String
        Dim re As Object, mc As Object
        Dim i As Long, j As Long
        Dim sFirstAddress As String
    Set rg1 = Range("B2", Cells(Rows.Columns.Count, "B").End(xlUp))
    Set rg2 = Range("D2", Cells(Rows.Columns.Count, "D").End(xlUp))
    Set re = CreateObject("vbscript.regexp")
        re.Global = True
        re.ignorecase = True
    With Range(rg1, rg2)
        .Font.Color = vbBlack
        .Font.Bold = False
        .Interior.Color = xlNone
        .FormatConditions.Delete
    End With
    For Each c In rg1
      re.Pattern = "\b\w+\b"
      If re.test(c.Text) = True Then
        Set mc = re.Execute(c.Text)
            ReDim sTempWords(0 To mc.Count - 1)
            For i = 0 To UBound(sTempWords)
                sTempWords(i) = mc(i)
            Next i
        For i = 0 To UBound(sTempWords)
            Set d = rg2.Find(What:=sTempWords(i), _
                             LookIn:=xlValues, _
                             LookAt:=xlPart, _
                             MatchCase:=False)
            If Not d Is Nothing Then
                re.Pattern = "\b" & sTempWords(i) & "\b"
                sFirstAddress = d.Address
                Do
                        If re.test(d.Text) Then
                    With c
                        .Font.Color = vbWhite
                        .Font.Bold = True
                        .Interior.Color = vbBlue
                    End With
                    With d
                        .Font.Color = vbWhite
                        .Font.Bold = True
                        .Interior.Color = vbBlue
                    End With
                        End If
                    Set d = rg2.FindNext(after:=d)
                    Loop While Not d Is Nothing And d.Address <> sFirstAddress
            End If
        Next i
      End If
    Next c
    Set re = Nothing
    End Sub
     

    Programming/Code related questions should really be posed in one of the following forums
    Excel for Developers
    http://social.msdn.microsoft.com/Forums/en-US/exceldev
    Microsoft Office Programming
    http://answers.microsoft.com/en-us/office/forum/customize?page=1&tab=all&tm=1361680524815
    Tony Chen
    TechNet Community Support

  • Search a word in combo & list all matching words in combo

    Hi,
        In my combo box theses following items are there
             Tom John
              John Joseph
             Christopher don
              Alex baby john
             eldho
             Hareesh M
              Sithaara rao
    I want to search a name that contains 'john' in any where . That means if I type 'john' in combo it will show all matching names  like tom john, john joseph, alex baby john etc in combo. I am workin with c# windows application.

    Use a list as the input to the combobox, then use Linq to search list
    List<string> input = new List<string>(){
    "Tom John",
    "John Joseph",
    "Christopher don",
    "Alex baby john",
    "eldho",
    "Hareesh M",
    "Sithaara rao"
    comboBox1.DataSource = input;
    List<string> output = input.AsEnumerable()
    .Where(x => x.ToUpper().Contains("JOHN")).ToList();
    jdweng

  • Primary layout does not match word document

    I named an RH project with a name the programmer cannot use.
    I tried to rename the project. 2 days later, I am in a mess. I
    bring up RH Explorer and click on its word document icon. I change
    information in the word document, compile and look at the 'View
    Primary Layout'. The document showing in the layout is not the
    document I just edited. How do I get the correct word document to
    be compiled and appear in the primary layout screen? Note: this
    happened after I lost RH and had to reinstall. See other
    posting.

    My guess is that you are looking at the DOC file with a laser printer or any other printer attached in the print menu. WORD reflows documents to be consistent with the attached printer. You are probably lucky that you made it through 75 pages before there was a problem. The 6 hours is also unreasonably long for the processing of 388 pages, unless everyone might have been a graphic. But even then, that is a huge amount of time.
    You are probably using PDF Maker (create PDF menu), but you should still attach the Adobe PDF printer and go through the document before printing or using PDF Maker. Also, go through the preferences in the create PDF menu to select only those things needed. Tags are good for recreating the DOC file (but it is better to not get rid of the DOC file in the first place). The other use for tags is accessibility -- that is often needed, but you might want to try turning it off to see the results.
    So, bottom line is to attach the Adobe PDF printer in the print menu and then go through the DOC file to check for the format you are concerned about and see if that duplicates what you are currently getting on p. 76. If it is the same, then you are seeing a standard process by WORD.

  • Output Does Not MATCH Word Document

    Everything is fine till it reaches page 76 (of my 388 page document) and the phrase: District of Columbia.
    The original document does not wrap District of Columbia, but the PDF file does.
    I am using the PDF printer.
    The problem is that District of Columbia is a bookmark linked to the table of contents. I see that during creation of the PDF file, Word goes into a mode that shows hidden text in bookmarks, etc. This makes the phase District of Columbia even longer than it normally is.
    A work around I am considering is choosing an oversized page for printing, but the names are criptic and I'll have to look up each to find out which would work. I'm very stuck. I have three other programs that can make a PDF out of the document in just minutes, but the links/bookmarks don't work at all.
    Creation using Acrobat (v XI) takes six hours. There are that many bookmarks in the document.
    Any suggestions?

    My guess is that you are looking at the DOC file with a laser printer or any other printer attached in the print menu. WORD reflows documents to be consistent with the attached printer. You are probably lucky that you made it through 75 pages before there was a problem. The 6 hours is also unreasonably long for the processing of 388 pages, unless everyone might have been a graphic. But even then, that is a huge amount of time.
    You are probably using PDF Maker (create PDF menu), but you should still attach the Adobe PDF printer and go through the document before printing or using PDF Maker. Also, go through the preferences in the create PDF menu to select only those things needed. Tags are good for recreating the DOC file (but it is better to not get rid of the DOC file in the first place). The other use for tags is accessibility -- that is often needed, but you might want to try turning it off to see the results.
    So, bottom line is to attach the Adobe PDF printer in the print menu and then go through the DOC file to check for the format you are concerned about and see if that duplicates what you are currently getting on p. 76. If it is the same, then you are seeing a standard process by WORD.

  • Highlight matching word in AutoSuggest

    I am using AutoSuggestBehavior component to implement type-ahead feature with inputText component. I am wondering if it is possible to highlight the matching letters in the suggested items.
    Here is an example:
    Say I have following LOV items:
    Oracle Application Server
    Oracle JDeveloper
    My Oracle Support
    Now when I type "Oracle", it should highlight (bold) the text "*Oracle*" within the suggested item. So the suggested items would look like this:
    Oracle Application Server
    Oracle JDeveloper
    My Oracle Support
    Is that possible? Is there any custom solution for this?
    Thanks!

    Hi,
    haven't tried, but in a similar use case for tables, I did parse the return values and added HTML markup to it. For example, you can add <b></b> around the string and see if it renders in bold. I think I used a tag that allowed me to use CSS for the color coding. Give it a try, maybe it works for you
    Frank

Maybe you are looking for

  • My 750GB Maxtor external HD will not mount on my iMac 10.7.5 for Time Machine

    This external drive has worked in the past; I had used it to successfully back up the same computer I'm using now. After attempting another long overdue backup, it aborted mid-way. I discovered some chew marks on the power cord and replaced it. The r

  • How to remove trailing space at the end of a song.

    This is related to this thread: Shorten song length (remove trailing bars) in Garageband 10.0.1 I have also done some Googling and have found some links related to selecting and exporting regions, which I have tried, but this is what I noticed. It do

  • Problem using a group which has a space in it's DN when using LDAP Group mappings in UCS 1.4

    Hey, We've been implementing LDAP authentication (Active Directory) using LDAP group mapping in UCS 1.4, and we've noticed that when using a group which has a DN with a space in it (such as "UCS Admins") it wouldn't authenticate the user with the app

  • DSC not logging data

    Hi all, For some reason, my DSC has stopped logging data. I have a fairly simple setup (8 modbus servers) that are being read as I/O servers in the DSC. I have checked the "Log Data"option, and this was working for several months. Recently, I had to

  • App installation Error 0008

    I am getting the 'Error 0008' when trying to re-install the free app Asphalt 6. I have run through changing my payment options based on several other posts to no avail. I have also moved between at least 5 different wireless connection in case that's