private void extractCandidatesFromRecentPostsToolStripMenuItem_Click(object sender, EventArgs e) { string requestId; CandidatesRecent candidateSettings = new CandidatesRecent(); if (candidateSettings.ShowDialog() == System.Windows.Forms.DialogResult.OK) { int count = int.Parse(candidateSettings.TextBoxCandidateCount.Text); string method = candidateSettings.GetConceptExtractionMethod(); GeneralQuery query = new GeneralQuery(new QGeneralParams() { ResultData = QResultData.keywordData, KeywordMethod = GetKeywordMethod(method), KeywordCount = count }, new QArgs(new QTimelineCond(candidateSettings.DateTimeStart.Value, candidateSettings.DateTimeEnd.Value))); string request = Defaults.BuildRequest(PublisherName, "Query", query.ToString(), out requestId); StatusText.Text = "Computing new candidates..."; SendRequest(request, requestId, "keywordsForRecentPosts"); } }
void RequestKeywordsForNextTagId() { if (_stopComputingCandidates || _tagIdsToProcess.Count == 0) { _computingCandidates = false; _stopComputingCandidates = false; Invoke((Action)(() => { StatusText.Text = ""; StatusProgressBar.Value = 0; })); return; } int tagsLeft = _tagIdsToProcess.Count; int tagId = _tagIdsToProcess.Dequeue(); GeneralQuery query = new GeneralQuery(new QGeneralParams() { ResultData = QResultData.keywordData, KeywordCount = _keywordsForTagCount, SampleSize = -1, KeywordMethod = GetKeywordMethod(_keywordsForTagMethod) }, new QArgs(new QTagIdCond(tagId))); string requestId; string request = Defaults.BuildRequest(PublisherName, "Query", query.ToString(), out requestId); SendRequest(request, requestId, "keywordsForTagId"); Invoke((Action)(() => { string tagName = _tagIdToTagInfo[tagId].TagName; StatusText.Text = String.Format("Computing concepts for tag {0} with id = {1} ({2:F2}% done) ", tagName, tagId, 100 * (_tagIdsToProcessCount - tagsLeft) / (float)_tagIdsToProcessCount); StatusProgressBar.Value = _tagIdsToProcessCount - tagsLeft; })); }
private void ButtonLearnDescription_Click(object sender, EventArgs e) { string conceptLabels = TextBoxLabels.Text; if (string.IsNullOrEmpty(conceptLabels)) { MessageBox.Show("In order to find keywords for a concept you first have to enter a set of labels for the concept."); return; } GeneralQuery query = new GeneralQuery(new QGeneralParams() { ResultData = QResultData.keywordData }, new QArgs(new QKeywordCond(conceptLabels))); string requestId; string request = Defaults.BuildRequest(PublisherName, "Query", query.ToString(), out requestId); SendRequest(request, requestId, "keywordsForDescription"); }