Esempio n. 1
0
        // for testing purposes only
        // runs all of the standard queries
        private void btnAutoQuery_Click(object sender, EventArgs e)
        {
            // do stuff
            // this is for testing only
            string queryFile = "../../cran_information_needs.txt";
            //string now = DateTime.Now.ToString("yyyymmddhhmmss");
            string resultsFile = "../../autoquery_results.txt";

            Dictionary <string, string> infoNeeds = InfoNeeds.GetInfoNeeds(queryFile);

            myIREngine.AutoResults(resultsFile, infoNeeds, chkProcess.Checked);
        }
Esempio n. 2
0
        // opens these info needs file and gets the user to
        // select a standard query
        private void btnOpenQueryFile_Click(object sender, EventArgs e)
        {
            // get the infoneeds txt file
            openFileDialog.Filter   = "Text Files (*.txt)|*.txt";
            openFileDialog.FileName = "";
            openFileDialog.ShowDialog();
            string selectedFile = openFileDialog.FileName;

            if (selectedFile != "")
            {
                // turn the file into a dictionary
                Dictionary <string, string> infoNeeds = InfoNeeds.GetInfoNeeds(selectedFile);

                // check if infoNeeds is null and report error
                if (infoNeeds == null)
                {
                    MessageBox.Show("That query file is not formatted correctly.");
                }
                else
                {
                    // open form for user to select query
                    frmQuerySelect getQuery = new frmQuerySelect(infoNeeds);

                    // wait for user to select a query
                    getQuery.ShowDialog();

                    // set the query text if the use has selected a query
                    topicID = getQuery.SelectedTopicID;
                    if (topicID != null)
                    {
                        string stdQueryText = infoNeeds[topicID];
                        txtQuery.Text      = stdQueryText;
                        this.ActiveControl = btnQuery;
                    }
                }
            }
            else
            {
                MessageBox.Show("No query file selected!");
            }
        }