I have searched online for a difference algorithm, but none of them is doing to me. This is for a texting contest (in the cell phone) and I need entry text in comparison to the master text that records errors on the way I am semi-new for C # and I get mostly string functions and not so It seems that this is a difficult problem, but regret is that I can not wrap my head around it. > I have 2 rich text boxes (one on top of the other) and 2 buttons. The top box is the master text and the bottom is the box entry text (string). Each competitor is sending a text to an email account, by email we copy and paste the text into the entry rtb and compare it to the master rtb. Each word and one place are counted as a place to examine a word, no matter how many mistakes, it is still 1 error and add 1 second to each error for your time.
Example: What I have yet I have made 6 arrays (3 for the master, 3 for entry) and they My greatest problem is if the entry text is missing It is small or taller than the master, I keep the index autoresponder exceptionally, but it can not be sure how to check the code and write to compensate. I hope I made myself clear That's what I need help with. Anyone can give some code example or something very useful to shoot me on the right path. you have algor It's the number of differences between the two strings that read errors in your case. By using the algorithm based on pseudo-code on the Wikipedia page, it passes through the first 3 cases of your 4 usage Is: So if the box is not perfect, it's probably a good starting point for you In addition, if you have too much difficulty in applying your scoring rules, then you may be able to alert them again. hth Here is the result of the string that you requested in the comments: and here Levenshitin da My implementation of the pre-algorithm is:
Apprehension. Array Aqual (2, Levenshatinistes ("Hello!", "Hello! Assurance.Arequalla (1, Levenshatidistes ("Hello Health!", "Hello!"); Assurance.Are Aqualell (4, Levenshatidistes ("Hello there! How are you?", "Hello! How do you Assurance.Air Aqualel (3, Levenshatinistes ("Hello there, how are you?", "Hello there! @ Ho you are?"); // fails, returns 4 errors
Updates:
Fearful.Arequal (7, Levenshatinistes ("Hello there, how are you?", "Hlothrey !! HW Rei Riyu? "); // Failure, 8 errors return
int levenshatestists (string left, string right) {if (left == faucet || Correct == faucet) {return -1;} if (left.layth == 0) {right right Long;} If (right length == 0) {Return to left. Lang;} int [,] distance = new int (left + lb + 1, right length + 1]; for (int i = 0; i & lt; = left.Length; i ++) {distance [i , For 0] = i;} (int j = 0; j & lt; = right.Length; j ++) {for interval [0, j] = j;} (int i = 1; i & lt ; = Left.Length; i ++) {for (int j = 1; j & lt; = right.Length; j ++) {if (right [j - 1] == left [i - 1]) { Distance [i, j] = Distance [i - 1, j - 1];} Distance from L {distance [i, j] = minimum (distance [i - 1, j] + 1, // extinction distance [i, j - 1] + 1, // Insertion distance [i - 1, j - 1] + 1); // replacement}}} return distance [left.lambi, right length];} int min (int val 1, Int val 2, int well 3) {write N math. Min (well 1, Math. Min (Val 2 Val 3));}
Comments
Post a Comment