public void boymoserch() { cls.UpdateData("truncate table serchmetaadvnc"); Stemming.PorterStemmer pf = new Stemming.PorterStemmer(); string ssh = pf.stemTerm(txtserch.Text); finlword = ssh; DataSet ds22 = new DataSet(); ds22 = obj.fillist(); BMSearch.CIBMSearcher BMS = new BMSearch.CIBMSearcher(finlword, CheckBox1.Checked); if (ds22.Tables[0].Rows.Count > 0) { for (int g = 0; g <= ds22.Tables[0].Rows.Count - 1; g++) { DataRow drw = ds22.Tables[0].Rows[g]; id = Convert.ToInt32(drw[0]); this.richTextBox1.Text = BMS.GetTable(); int index = BMS.Search(drw[1].ToString(), 0); if (index == -1) { } else { //obj.ser_UP_ID = id; //obj.ser_count = 1; //obj.counter = 0; //obj.baseserch(); } DataSet ds = new DataSet(); obj.ser_UP_ID = id; ds = obj.advncemetalist(); if (ds.Tables[0].Rows.Count > 0) { for (int h = 0; h <= ds.Tables[0].Rows.Count - 1; h++) { DataRow drw2 = ds.Tables[0].Rows[h]; int index2 = BMS.Search(drw2[1].ToString(), 0); if (index2 == -1) { } else { obj.ser_count = Convert.ToInt32(drw2[2]); obj.ser_UP_ID = id; obj.counter = 0; obj.baseserch(); } } } } } num0 = GenRand(0.0, 1.2); a = a + num0; a = Math.Round(a, 2); }
public void matadata() { try { pid = Convert.ToInt32(cls.RetVal("select Top 1 up_id from advncuploadfileslist order by up_id desc")); string filename = (Server.MapPath("~/all/advance/") + txtfilename.Text); string inputString = File.ReadAllText(filename); inputString = inputString.ToLower(); string[] doc = new string[1] { inputString.ToString() }; //ServiceRanking.TFIDFMeasure tf = new ServiceRanking.TFIDFMeasure(doc); string[] stripChars = { ";", ",", ".", "-", "_", "^", "(", ")", "[", "]","'", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "\n", "\t", "\r" }; foreach (string character in stripChars) { inputString = inputString.Replace(character, ""); } List<string> wordList = inputString.Split(' ').ToList(); stpwordshndl stopwords = new stpwordshndl(); string[] stopword = stopwords.StopWordsHandler(); foreach (string word in stopword) { while (wordList.Contains(word)) { wordList.Remove(word); } } foreach (string word in wordList) { Stemming.PorterStemmer pf = new Stemming.PorterStemmer(); string ssh = pf.stemTerm(word); skk = ssh + " " + skk; } List<string> wordList2 = skk.Split(' ').ToList(); Dictionary<string, int> dictionary = new Dictionary<string, int>(); foreach (string word in wordList2) { if (word.Length > 3) { if (dictionary.ContainsKey(word)) { dictionary[word]++; } else { dictionary[word] = 1; } } } var sortedDict = (from entry in dictionary orderby entry.Value descending select entry).ToDictionary(pair => pair.Key, pair => pair.Value); cumfun obj = new cumfun(); foreach (KeyValuePair<string, int> pair in sortedDict) { if (pair.Value <= 2) { } else { obj.UpdateData("insert into matadataadvnce values('" + pair.Key + "','" + pair.Value + "','" + pid + "')"); } } clearall(); Label1.Visible = true; Label1.Text = "File Uploaded Successfully."; Label1.ForeColor = System.Drawing.Color.Green; } catch { Label1.Visible = true; Label1.Text = "Error Please try again."; Label1.ForeColor = System.Drawing.Color.Red; } }
public void matadata() { try { pid = Convert.ToInt32(cls.RetVal("select Top 1 up_id from advncuploadfileslist order by up_id desc")); string filename = (Server.MapPath("~/all/advance/") + txtfilename.Text); string inputString = File.ReadAllText(filename); inputString = inputString.ToLower(); string[] doc = new string[1] { inputString.ToString() }; //ServiceRanking.TFIDFMeasure tf = new ServiceRanking.TFIDFMeasure(doc); string[] stripChars = { ";", ",", ".", "-", "_", "^", "(", ")", "[", "]", "'", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "\n","\t", "\r" }; foreach (string character in stripChars) { inputString = inputString.Replace(character, ""); } List <string> wordList = inputString.Split(' ').ToList(); stpwordshndl stopwords = new stpwordshndl(); string[] stopword = stopwords.StopWordsHandler(); foreach (string word in stopword) { while (wordList.Contains(word)) { wordList.Remove(word); } } foreach (string word in wordList) { Stemming.PorterStemmer pf = new Stemming.PorterStemmer(); string ssh = pf.stemTerm(word); skk = ssh + " " + skk; } List <string> wordList2 = skk.Split(' ').ToList(); Dictionary <string, int> dictionary = new Dictionary <string, int>(); foreach (string word in wordList2) { if (word.Length > 3) { if (dictionary.ContainsKey(word)) { dictionary[word]++; } else { dictionary[word] = 1; } } } var sortedDict = (from entry in dictionary orderby entry.Value descending select entry).ToDictionary(pair => pair.Key, pair => pair.Value); cumfun obj = new cumfun(); foreach (KeyValuePair <string, int> pair in sortedDict) { if (pair.Value <= 2) { } else { obj.UpdateData("insert into matadataadvnce values('" + pair.Key + "','" + pair.Value + "','" + pid + "')"); } } clearall(); Label1.Visible = true; Label1.Text = "File Uploaded Successfully."; Label1.ForeColor = System.Drawing.Color.Green; } catch { Label1.Visible = true; Label1.Text = "Error Please try again."; Label1.ForeColor = System.Drawing.Color.Red; } }