1

unfortunately I am struggling a bit with what I thought would be an easy task. I am writing an autocorrect in AHK for words I frequently mistype, and instead of writing every possible way to write every word incorrectly I have written a list with words I often mistype in their correct form. I now want to take each item from that list, leave the first character as is and randomize two consectutive letters in every possible way with the exclusion "is already in list". So in pseudo code it would be:

For each word in correctWords

{
FirstLetter = split to chararray(0)
newWord = split to chararray(>0)
randomized = Firstletter + newWord.randomizeTwoLetters
if(!correctWords.Contains(randomized); correctWords.AddToList(randomized))
}

The part I struggle with is obviously the randomizeTwoLetters(), how would you go about that?

I hope you can help me, thank you!

harshtuna
  • 757
  • 5
  • 14
Kraken
  • 11
  • 1
  • To clarify: I want to write a c# snippet that reads the textfile, formats as requested and then writes another textfile with the actual AHK script – Kraken Jun 21 '15 at 18:40
  • 2
    edit your question to include that, instead of as a comment – Alejandro Jun 21 '15 at 18:41

1 Answers1

0

Pulled from the AutoHotkey Help File: AutoCorrect 4700 Common Words

If you still want to do this yourself (in C#?) look into various algorithms like: Generating a random sequence with no repeats for starters.

Community
  • 1
  • 1
errorseven
  • 2,672
  • 2
  • 14
  • 20