1
Answer

Display Misspelled words between two strings in asp.net

User77

User77

8y
295
1
In my application, I have two strings and I need to display missing words that count, Inserting words that count and modified words that count between them. For example:
 
string variable1="When you are writing server code you can never be sure what the IP address you see is refereeing to.In fact some users like it this way.";
string variable2="are wrting server code yu cannn never be sure Demo what 
the address you is to.In fact Demo1 some users like it this way";

The result should be:

 Missing Words: see ,IP
Missing Words count: 2

Inserted: Demo, Demo1
  Inserted Words count: 2

  Modified words : wrting,yu ,cannn ,refering
Modified words count :4

 //Missing Word Count
 var result = variable1.Split(new char[] { ' ' }).Except(variable2.Split(new char[] { ' ' })).ToArray();
 count
= result.Length;
 Label2.Text += "Missing Word Count: " + count.ToString() + "<br/><br/>";
 for (int i = 0; i < count; i++)
 {
Label1.Text += "Missing Word: " + result[i].ToString() + "<br/><br/>";
}

 //Insert Word
var result1 = variable2.Split(new char[] { ' ' }).Except(variable1.Split(new char[] { ' ' })).ToArray();
count
= 0;
count
= result1.Length;
for (int i = 0; i < count; i++)
 {
Label3.Text += "Insert Word: " + result1[i].ToString() + "<br/><br/>";
 }
 Label4.Text += "Insert Word Count: " + count.ToString() + "<br/><br/>";

 //Modifide Words
string[] tempArr1 = variable1.Split(' ');
string[] tempArr2 = variable2.Split(' ');
int counter = 0;
for (int i = 0; i < tempArr1.Length; i++)
{
if (tempArr1[i] != tempArr2[i])
{
lblwords.text=tempArr1[i] + ", "+ tempArr2[i];
 counter
++;
}
}

My requirement is need to display missing words,inserted words and modified words
between two large strings(documents). i am getting missing and inserted words
but i didn't get modified words.i am trying this but i am not getting
can anyone please help me it's very urgent requirement.

Thank you

Answers (1)
1
Manas Mohapatra

Manas Mohapatra

NA 29.3k 3.3m 7y
If you want to display email notification in user system, then I am not sure you can achieve that. Because it is user system and you can't do any change through WebApp. 
 
If you want to display notification in web application to user then you can achieve it.
 
0
sameer shaikh

sameer shaikh

NA 172 8k 7y
 Thanks guys
 
Regards
Sameer shaikh 
0
Sameer Shaik

Sameer Shaik

NA 953 1k 7y
As Ramesh said, its not in your hand. its not logical.  
0
Ramesh Palanivel

Ramesh Palanivel

NA 9.5k 138.6k 7y
Hi Sameer,
 
Thats what I am saying, You cannot do it in your coding.. It have to be configured in their mail settings.
 
 
0
sameer shaikh

sameer shaikh

NA 172 8k 7y
@Rakesh
 
sorry, Actually i didn't mention one thing i have User table that contain list of users and am going to send email to all.
 
if end users gmail/hotmail account is open,show him notification,
 
can i achive this kind of logic at my side i.e using coding.
 
Regards
Sameer Shaikh 
 
 
 
 
0
Ramesh Palanivel

Ramesh Palanivel

NA 9.5k 138.6k 7y
Hi Sameer,
 
 
I think you cannot achieve this in from your end. It has to be configured in receiver mail settings. 
 
You can send the mail to any mail services, which mean it may be an Yahoo,gmail or rediffmail whatever may be...
 
The mail receive notification wants to be configured in their mail settings.