I want to generate a random string of letters. However, I do not want, that there are any words in this string.
Good example: hfjdksahffdfkdjdfasdf
Bad example: jfdkstackoverflowjklö
I know, that I could just ban, the vowels and that will probably take care of most of the work. However, that would also significally reduce the possibillities and therefore the number of maximum generated Strings in any given lenght.
This method would also have an extremely high margin of error, due to the fact, that not everything that contains a vowel is a word. So I'd much rather go with the Idea of banning letter combinations. Due to that fact, that there are far less "wrong" words that would get filtered out.
I do not want to filter out every word, but I do want to get rid of most of them. So there is no need to compare it with a dictionary or so. I'm totally fine with a few words in my string.
It's more importan to me, to keep as many possibillities per string-lenght as possible.
For example the letter combinations "TH" and "HE" are the most common (as I beleve), they appear in about 3% of all words.
So I'd rather go with two or three letter combinations, because there are far more possibillities (that I have more) than in comparison the percentage of words that I filter out.
Aucun commentaire:
Enregistrer un commentaire