If a lot of strings are of course known, they use GPERF to create the perfect hash function.
Follow this with a SOUNDEX hash (string) that uses a linked list to resolve conflicts.
Use the first set for an exact search. Use the second set for close matches.
EDIT: since your alphabet is only 5 characters, you have the option of creating multiple hash tables to reduce the size of your N.
, . AAAAA, A. AABBBB, AB ABCDEF. 5 . 120 - -, .
, , . , . ? , , ?