1

I'm working with Elm, but any kind of pseudocode is welcome. This is not homework - it's a personal project. I'm looking to implement a more advanced search, without using "fuzzy" searching. I will give a few examples of what I would like.

Searching "coa" should find "Cathedral of Aachen", but NOT "Charcoal"

Searching "braek" should not find "break" (though if it fit the other requirements, I'm okay if it does)

Given the string, "This is a test for a string search", the algorithm should find a match with "tistestase", finding the capital letters in the following: "This IS a TEST for A string SEarch" Note that "is" did not get highlighted in "thIS", because it is not the beginning of a word. Also note that the second last character in the search entry, "s", is not found in "String", but instead, it is compounded with the last character to find "SEarch". This last point is what I'm having trouble figuring out mainly. How do I know to ignore a valid letter, so that it doesn't fail further along? If the S from "string" was found, the final "e" would cause the search to fail.

The search should be able to find full words as well. If I were to search "special edition", it would return successful if it found "SPECIAL limited EDITION".

If there's a solution, or a term out there that I can search to help my with my issue, that would also be appreciated. If it is also fuzzy, but fits my other criteria, I'll be happy.

  • 1
    Bit confused about what your asking but have a look at this https://stackoverflow.com/questions/7331462/check-if-a-string-is-a-possible-abbrevation-for-a-name – jbflow Mar 31 '21 at 23:49
  • Extract the first letters, and search for these. – wildplasser Mar 31 '21 at 23:56
  • The only issue I have for that criteria is that aik is a match for allmanna idrottskluben, because the k is in the middle of the word. Other than that, the rest seem to fit my needs. – Braxton Istace Mar 31 '21 at 23:57

0 Answers0