Example #1
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            int xxxxxx = Int32.Parse(textBox6.Text);

            textBox5.Text = ClassFSMD.GetOneDat(xxxxxx).HtmDat;

            nSearch.ClassLibraryHTML.ClassHTML dd = new nSearch.ClassLibraryHTML.ClassHTML();
            textBox7.Text = dd.GetClearCode(textBox5.Text , true);
        }
Example #2
0
        /// <summary>
        /// ��ʼ����
        /// </summary>
        private void RunStart()
        {
            nSearch.DebugShow.ClassDebugShow.WriteLineF(" ��ʼ������");

            //�Ѿ����ڵĻ�Ϊ����
            if (System.IO.File.Exists(indexDirectory + "segments") == true)
            {

                writer = new IndexWriter(indexDirectory, OneAnalyzer, false);
            }
            else
            {
                writer = new IndexWriter(indexDirectory, OneAnalyzer, true);
            }

            string AIDStart = getFileData(idp_filename);
            if (AIDStart.Length > 0)
            {
                XX_AIDStart = Int32.Parse(AIDStart);
            }
            else
            {
                XX_AIDStart = 0;
            }

            writer.SetUseCompoundFile(true);

            writer.SetMaxBufferedDocs(100);

            writer.SetMergeFactor(100);

            nSearch.DebugShow.ClassDebugShow.WriteLineF(" ��ʼ������[OK]");

            //�ļ�ID���ձ�
            //ArrayList mID = nSearch.FS.ClassFSMD.GetUrlList();

            int iii = nSearch.FS.ClassFSMD.GetFileNum();

            nSearch.ClassLibraryHTML.ClassHTML myTag = new nSearch.ClassLibraryHTML.ClassHTML();

            //ѭ��

            for (int i = XX_AIDStart; i < iii; i++)
            {

                if (i == 19)
                {

                    int uu = 0;
                }

                nSearch.FS.oneHtmDat  newDat = nSearch.FS.ClassFSMD.GetOneDat(i);

                nSearch.DebugShow.onePage mmm = (nSearch.DebugShow.onePage)myTag.GetOnePage(newDat.HtmDat, newDat.url);

                Lucene.Net.Documents.Document doc = nSearch.ModelData.ClassModelData.GetOneDoc(newDat.url,    mmm.Title, mmm.Body,0);
                nSearch.DebugShow.ClassDebugShow.WriteLineF("==����-> " + i.ToString());
                writer.AddDocument(doc);

                nSearch.DebugShow.ClassDebugShow.WriteLineF("++����-> "+i.ToString());

                XX_AIDStart = i;

                if (i % 200 == 46)
                {
                    nSearch.DebugShow.ClassDebugShow.WriteLineF("���浱ǰ�������ļ�λ��ָ��-> " + i.ToString());
                    putFileData(idp_filename, XX_AIDStart.ToString());
                }

            }
            XX_AIDStart = XX_AIDStart + 1;
            nSearch.DebugShow.ClassDebugShow.WriteLineF("���浱ǰ�������ļ�λ��ָ��-> " + XX_AIDStart.ToString());
            putFileData(idp_filename, XX_AIDStart.ToString());

            writer.Optimize();

            writer.Close();

            nSearch.DebugShow.ClassDebugShow.WriteLineF(" ����[OK]");
        }
Example #3
0
        /// <summary>
        /// ����һ��ģ��
        /// </summary>
        /// <param name="mpathc">ģ��·��</param>
        /// <param name="nm">����</param>
        /// <param name="modName">ģ������</param>
        private void CompModIt(string mpathc, Hashtable nm,string modName)
        {
            nSearch.ClassLibraryHTML.ClassHTML mHtm = new nSearch.ClassLibraryHTML.ClassHTML();

             //����Ԥ����  �����������
               Hashtable  nT = new Hashtable ();
               nT.Clear();

               foreach (DictionaryEntry HI in nm)
               {

               string url = HI.Key.ToString();

               nSearch.DebugShow.onePage nnt_mp = (nSearch.DebugShow.onePage)mHtm.GetOnePage(HI.Value.ToString(), url);

                string HtmDat = nnt_mp.Body;

               //ȡ��Title��� Body �ֿ����� ���Ч��
               //Title�Զ���Ϊ��0�� ��������

               nT.Add(url, HtmDat);

               }

               nSearch.DebugShow.ClassDebugShow.WriteLineF(" ���ݼ������ ");

               //�͵����������д���
               TMM(nT, mpathc+modName);

             //������
        }
Example #4
0
        private void comboBox_f_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboBox_f.Text.Length > 0)
            {

              string   aurl  = comboBox_f.Text;

                int id = -1;

                for (int uiy = 0; uiy < mID.Count; uiy++)
                {
                    if (aurl == mID[uiy].ToString())
                    {
                        id = uiy;
                        break;
                    }
                }

                if (id > -1)
                {
                    string newDat = nSearch.FS.ClassFSMD.GetOneDat(id).HtmDat;

                    nSearch.ClassLibraryHTML.ClassHTML myTag = new nSearch.ClassLibraryHTML.ClassHTML();

                    nSearch.DebugShow.onePage mmm = (nSearch.DebugShow.onePage)myTag.GetOnePage(newDat, "");

                    textBox7.Text = mmm.Body;

                }

            }
        }
Example #5
0
        private void button3_Click_1(object sender, EventArgs e)
        {
            nSearch.ClassLibraryHTML.ClassHTML dd = new nSearch.ClassLibraryHTML.ClassHTML();

            //�����˲���
            nSearch.ClassLibraryStruct.ClassUserModel m = new nSearch.ClassLibraryStruct.ClassUserModel();

            //ѹ�����ģ��
            m.TestModeL(textBox_a.Text, textBox_b.Text, textBox_c.Text, textBox_d.Text, textBox_e.Text, textBox_t.Text, textBox_h.Text, "", textBox_TA1.Text , textBox_TA2.Text );

            nSearch.ClassLibraryStruct.auto2dat k = m.getTagAndData(textBox7.Text);

            Hashtable p = m.modelOneList;

            listBox2.Items.Clear();

            foreach (System.Collections.DictionaryEntry de in p)
            {

                listBox2.Items.Add(de.Key.ToString() + '\t' + de.Value.ToString());
            }

            textBox_a1.Text = k.A;
            textBox_b1.Text = k.B;
            textBox_e1.Text = dd.GetClearCode(   k.E,true);

            textBox_c1.Text = k.C;

            textBox_d1.Text = k.D;

            textBox_TAc1.Text = k.A_TYPE_1;
            textBox_TAc2.Text = k.A_TYPE_2;
        }