You are right, I need to case sort the words and then it works perfectly.
I was planning on sorted them by a "priority" too, but I guess that is no longer a valid option.
I used a space separator because the place where I found the rest of the code(the current code completion plugin) used a space separator.
I am going to switch to a newline separator now.