I am currently trying to utilize an input, an output, with vowels and numbers.
If I input any word, then based on the vowels a, e, i, o, u, along with calculating every possible output from the given info, the program spits out every combo.
Example of process:
User inputs the word "cat" Program takes every vowel (aeiou) and creates permutations that look like: "ct cat cet cit cot cut" ("ct" with no vowel at all for various reasons) Then compare each word to DictionaryList (which I already have set up) and remove any entries that are misspelled. So how would I go about taking the dynamically generated input from the user (the word cat), detecting all instances of vowels in the input (cAt) and outputting all available combos? Sounds simple at first, but suppose the word "abomination" is plugged in.
Example of code I'm using:
'This is the Function I found online (link at bottom)
Private Function CartesianProduct(Of T)(ParamArray Sequences As T()()) As T()()
Dim Result As IEnumerable(Of T()) = {New T() {}}
Dim Var As String() = {}
For Each Sequence In Sequences
Dim S = Sequence
Result = From Seq In Result
From Item In S
Select Seq.Concat({Item}).ToArray()
Next
Return Result.ToArray()
End Function
'These 2 pieces are the vowels and numbers:
Dim S1 As String() = New String() {"", "a", "e", "i", "o", "u"}
Dim S2 As String() = New String() {"1", "2"}
'Permutation Operation:
Dim SS As String()() = CartesianProduct(S1, S2)
'Create the Output
Dim Output As String = Nothing
'Combine both Inputs
For i = 0 To SS.GetLength(0) - 1
Output = Output & Join(SS(i)).Replace(" ", Nothing) & " "
Next
MsgBox(Output)
So basically, how can I properly use the input with the permutation to replace all vowels from within the input and give me an output? Thank you for whoever can solve this!!! You are saving me from brain strain!!!
PS: The second string, S2, is for numerics, I need it because I need to calculate the above SS string scenerio, not just any S1 or S2).
PPS: Here is a diagram: Diagram of 2 dimensions of permutation