private void TokenizeTextToWords() { List <clsTolkappiyam> lstDetails = new List <clsTolkappiyam>(); commonFunctions objFunction = new commonFunctions(); StringBuilder sb = new StringBuilder(); //this will load the entire Tolkappiyam details lstDetails = objFunction.LoadTolkappiyamDetails(); //use the necessary normal or parsed text details foreach (clsTolkappiyam obj in lstDetails) { if (string.IsNullOrEmpty(sb.ToString())) { if (rbNormal.Checked) { sb.Append(obj.Original).Append("."); } else if (rbParsed.Checked) { sb.Append(obj.Text).Append("."); } } else { if (rbNormal.Checked) { sb.Append(" ").Append(obj.Original).Append("."); } else if (rbParsed.Checked) { sb.Append(" ").Append(obj.Text).Append("."); } } } //CompleteText will contain the either the normal lines or parsed lines seperated by a space CompleteText = sb.ToString(); }
private void TokenizeTextToWords() { List <clsTolkappiyam> lstDetails = new List <clsTolkappiyam>(); commonFunctions objFunction = new commonFunctions(); StringBuilder sb = new StringBuilder(); //this will load the entire Tolkappiyam details lstDetails = objFunction.LoadTolkappiyamDetails(); //use the necessary normal or parsed text details //CompleteText will contain the either the normal lines or parsed lines seperated by a space if (tabFunctional.SelectedTab == tabPage3) { foreach (clsTolkappiyam obj in lstDetails) { if (string.IsNullOrEmpty(sb.ToString())) { if (rbNormal.Checked) { sb.Append(obj.Original).Append("."); } else if (rbParsed.Checked) { sb.Append(obj.Text).Append("."); } } else { if (rbNormal.Checked) { sb.Append(" ").Append(obj.Original).Append("."); } else if (rbParsed.Checked) { sb.Append(" ").Append(obj.Text).Append("."); } } } NormalOrParsedText = sb.ToString(); NormalOrParsedText = NormalOrParsedText.Replace('.', ' '); PerformPhonemicOperations(); } else if (tabFunctional.SelectedTab == tabPage4) { foreach (clsTolkappiyam obj in lstDetails) { if (string.IsNullOrEmpty(sb.ToString())) { if (rbNormalPh2.Checked) { sb.Append(obj.Original).Append("."); } else if (rbParsedPh2.Checked) { sb.Append(obj.Text).Append("."); } } else { if (rbNormal.Checked) { sb.Append(" ").Append(obj.Original).Append("."); } else if (rbParsed.Checked) { sb.Append(" ").Append(obj.Text).Append("."); } } } NormalOrParsedText = sb.ToString(); NormalOrParsedText = NormalOrParsedText.Replace('.', ' '); DoSyllabicStructureForAll(); } }
private void LoadWordsWithCount() { List <clsTolkappiyam> lstDetails = new List <clsTolkappiyam>(); commonFunctions objFunction = new commonFunctions(); StringBuilder sb = new StringBuilder(); string strCompleteText = string.Empty; //this will load the entire Tolkappiyam details lstDetails = objFunction.LoadTolkappiyamDetails(); //use the necessary normal or parsed text details foreach (clsTolkappiyam obj in lstDetails) { if (string.IsNullOrEmpty(sb.ToString())) { if (rbNormal.Checked) { sb.Append(obj.Original); } else if (rbParsed.Checked) { sb.Append(obj.Text); } } else { if (rbNormal.Checked) { sb.Append(" ").Append(obj.Original); } else if (rbParsed.Checked) { sb.Append(" ").Append(obj.Text); } } } //CompleteText will contain the either the normal lines or parsed lines seperated by a space strCompleteText = sb.ToString(); Tokenizer objTokenize = new Tokenizer(); List <WordCount> lstOutput = null; //will return unique word with count in sorted order if (rbNormal.Checked) { lstOutput = objTokenize.TokenizeWordswithCount(strCompleteText, objFunction.LoadNormalFormWithSandhi()); } else { lstOutput = objTokenize.TokenizeWordswithCount(strCompleteText, objFunction.LoadParsedFormWithSandhi()); } lblWordCount.Text = lstOutput.Count.ToString(); //Display in GridControl DataSet ds = new DataSet(); ds.Tables.Add(); ds.Tables[0].Columns.Add("சொல்", typeof(string)); ds.Tables[0].Columns.Add("பிறவடிவங்கள்", typeof(string)); ds.Tables[0].Columns.Add("எண்ணிக்கை", typeof(string)); foreach (WordCount result in lstOutput) { ds.Tables[0].Rows.Add(result.Word, result.OtherForm, result.Count); //comboBox1.Items.Add(result.Word); } dataGridView1.DataSource = ds.Tables[0]; DataGridViewCellStyle style = new DataGridViewCellStyle(); style.Font = new Font(dataGridView1.Font, FontStyle.Bold); dataGridView1.RowHeadersDefaultCellStyle = style; //dataGridView1.Columns[0] dataGridView1.Columns[0].Width = 120; dataGridView1.Columns[1].Width = 120; dataGridView1.Columns[2].Width = 100; rbFrequency.Checked = true; }