Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | porsukk | |
Old Version | Published before Godot 3 was released. |
I need a dictionary to check if a word exist and to make searches like if there is a word which starts with specific letters. For example user input “big”. I need dic.has(“big”) and also dic.get_words(“big”)-> big,bigger. Currently I have a file which contains all the valid words and a file which contains the tokens for searching.
file1:
big
bigger
file2:
b
bi
big
bigg
bigge
bigger
I read the words and tokens to a dictionary and use the dictionary to make the searches. Problem is reading this many words takes 3-4 seconds on mobile phones. There is probably more clever way to do this. Something does not require me to read the whole file. So what is the best way to implement this kind of structure in godot?
Thank you in advance.