Summary description for TermVector.
Inheritance: System.Windows.Forms.Form
Beispiel #1
0
        internal void ShowTV()
        {
            if (listDocFields.SelectedItems.Count == 0)
            {
                return;
            }
            if (_luke.IndexReader == null)
            {
                _luke.ShowStatus(_luke.resources.GetString("NoIndex"));
                return;
            }

            int docId;

            try
            {
                docId = Int32.Parse(textDocNum.Text);
            }
            catch (Exception)
            {
                _luke.ShowStatus(_luke.resources.GetString("DocNotSelected"));
                return;
            }

            try
            {
                string fieldName = listDocFields.SelectedItems[0].SubItems[0].Text;
                fieldName = fieldName.Substring(1, fieldName.Length - 2);
                TermFreqVector tfv = _luke.IndexReader.GetTermFreqVector(docId, fieldName);
                if (tfv == null)
                {
                    _luke.ShowStatus(_luke.resources.GetString("NoTV"));
                    return;
                }

                TermVector tvDialog = new TermVector(fieldName, tfv);
                tvDialog.ShowDialog(this);
            }
            catch (Exception exc)
            {
                _luke.ShowStatus(exc.Message);
            }
        }
Beispiel #2
0
        internal void ShowTV()
        {
            if (listDocFields.SelectedItems.Count == 0) return;
            if (_luke.IndexReader == null)
            {
                _luke.ShowStatus(_luke.resources.GetString("NoIndex"));
                return;
            }

            int docId;
            try
            {
                docId = Int32.Parse(textDocNum.Text);
            }
            catch (Exception)
            {
                _luke.ShowStatus(_luke.resources.GetString("DocNotSelected"));
                return;
            }

            try
            {

                string fieldName = listDocFields.SelectedItems[0].SubItems[0].Text;
                fieldName = fieldName.Substring(1, fieldName.Length - 2);
                TermFreqVector tfv = _luke.IndexReader.GetTermFreqVector(docId, fieldName);
                if (tfv == null)
                {
                    _luke.ShowStatus(_luke.resources.GetString("NoTV"));
                    return;
                }

                TermVector tvDialog = new TermVector(fieldName, tfv);
                tvDialog.ShowDialog(this);
            }
            catch (Exception exc)
            {
                _luke.ShowStatus(exc.Message);
            }
        }