void changeOperatorColor() { Analyser analyser = new Analyser(); string[] lines = textUrdu.Text.Split('\n'); foreach (var line in lines) { string[] words = analyser.analyse(line).Split(); foreach (var word in words) { if (Operators.find(word.Trim()) != "null") { if (textUrdu.Text.Contains(word)) { textUrdu.Select(textUrdu.Text.IndexOf(word), (word.Length)); textUrdu.SelectionColor = Color.Red; textUrdu.DeselectAll(); } } else if (KeyWords.find(word.Trim()) == "null") { textUrdu.Select(textUrdu.Text.IndexOf(word), (word.Length)); textUrdu.SelectionColor = Color.Black; textUrdu.DeselectAll(); } } } }
private void wrapWord(string lineString) { string[] words = analyser.analyse(lineString).Split(); for (int i = 0; i < words.Length; i++) { if (KeyWords.find(words[i]) != "null") { outPut += KeyWords.find(words[i]).Trim() + " "; } else if (Operators.find(words[i]).Trim() != "null") { outPut += Operators.find(words[i]).Trim() + " "; } else if (words[i] == " " || words[i] == "") { } else { //outPut += words[i]; string translated = translator.Translate(words[i]); outPut += (translated[0]) + translated.Substring(1).Replace(" ", String.Empty) + " "; } } }