I’ve been working for some time on an app that contains a lot of written text. This information was seperated into over 200 categories with each one having at least 3 blocks of text.
I would like to give the user the possibility to search for some keywords to find one of the text blocks since that is much easier to do than navigate over that many categories.
I have all those text blocks saved in a
string = "This is the tutorial. Press A to jump and B to attack."
string = "This area is known as the city of Dhismir, do not enter it without preparations."
string = "This is the legendary sword of Thasburg, it doesn't belong to you. Let me tell you its story"
I could easily make a simple script that checks if the string contains the keywords, but I want my search engine to accept some errors by the user:
- Some words might be spelled differently by some users. The word “Thasburg” might be replaced by “Thusborg” or “thusburg”. This is the main problem since my app is full of words that are often spelled differently depending on the user.
- Some small words like “the” or “to” might be omitted but I don’t know how much I can omit while keeping the search accurate enough.
I’ve done some research but I couldn’t find a simple search engine that is integrated in unity.
I would like my app to be offline so I can’t use web based searches. I have found only a few tutorials about Linq in unity so I don’t really understand how to make a search engine with it. I have found an adaptation of Lucene for Unity on github but I’ve never used Lucene before and the unity version has got no example and almost no documentation.
If someone knows a working example or tutorial with unity that would be really nice. I would also appreciate some ideas about the functions that I can use to search the strings and on how to account for the user errors please.