public ClasterAnalysisForm(StatsAnalysisResult<WordDigram> singleData) { InitializeComponent(); cbx_TextSelection.Enabled = false; cbx_TextSelection.Items.Add(singleData.Name); cbx_TextSelection.SelectedIndex = 0; this.singleData = singleData; }
private void btn_ProvideStatsAnalysis_Click(object sender, EventArgs e) { if (Program.isSingleRegime) { singleData = Program.client.ProvideDigramsStatsAnalysis(data); fillListbox(singleData, (string)cbx_StatSelection.SelectedItem); } else { multiData = Program.client.ProvideDigramsStatsAnalysisMulticore(listData); cbx_TextSelection.Enabled = true; fillListbox(multiData.First(i => i.Name == (string)cbx_TextSelection.SelectedItem), (string)cbx_StatSelection.SelectedItem); } cbx_StatSelection.Enabled = true; btn_Continue.Enabled = true; }
private void fillListbox(StatsAnalysisResult<WordDigram> data, string statFilter) { lstb_StatsAnalysisResult.Items.Clear(); switch (statFilter) { case "Частотный словарь": lstb_StatsAnalysisResult.Items.AddRange(data.Frequency_Dictionary.Select(i => string.Format("{0} {1} : {2}", i.Key.FirstWord, i.Key.SecondWord, (int)i.Value)).ToArray()); break; case "Loglikelihood": lstb_StatsAnalysisResult.Items.AddRange(data.LogLikelihood_Dictionary.Select(i => string.Format("{0} {1} : {2}", i.Key.FirstWord, i.Key.SecondWord, i.Value)).ToArray()); break; case "Mutual information": lstb_StatsAnalysisResult.Items.AddRange(data.MutualInformation_Dictionary.Select(i => string.Format("{0} {1} : {2}", i.Key.FirstWord, i.Key.SecondWord, i.Value)).ToArray()); break; case "Tscore": lstb_StatsAnalysisResult.Items.AddRange(data.TScore_Dictionary.Select(i => string.Format("{0} {1} : {2}", i.Key.FirstWord, i.Key.SecondWord, i.Value)).ToArray()); break; } }