Пример #1
0
        void btnTextSpotIndexing_Click(object sender, EventArgs e)
        {
            btnTextSpotIndexing.Enabled = false;
            List <TextSpot> textSpot     = FileManager.GetInstance().DeserializeJson(ConfigCommon.TEXT_PLOTTING_PATH);
            IndexStorage    indexStorage = new IndexStorage(ConfigCommon.TEXTSPOTTING_INDEX_STORAGE);

            indexStorage.OpenIndexStore();

            Indexing.IndexFromDatabaseStorage(indexStorage, textSpot);

            indexStorage.CloseIndexStorage();

            btnTextSpotIndexing.Enabled = true;
        }
Пример #2
0
        void btnTextCaptionIndexing_Click(object sender, EventArgs e)
        {
            btnTextCaptionIndexing.Enabled = false;

            lblStatus.Text = "Convert Data Json to List TextCaption";

            lblStatus.Text = "Create IndexStorage";
            IndexStorage indexStorage = new IndexStorage(ConfigCommon.CAPTION_INDEX_STORAGE);

            indexStorage.OpenIndexStore();

            //FileInfo[] files = FileManager.GetInstance().GetAllFileInFolder(ConfigCommon.TEXT_CAPTION_PATH);
            //foreach (FileInfo f in files)
            //{
            //    List<TextCaption> caption = JsonConvert.DeserializeObject<List<TextCaption>>(FileManager.GetInstance().ReadContentFile(f.FullName));
            //    Console.WriteLine(caption.Count);
            //    lblStatus.Text = "Indexing....";
            //    Indexing.IndexFromDatabaseStorage(indexStorage, caption);
            //}
            List <TextCaption> caption = ReadTextCaptionsIndex(@"D:\SoureThesis\Data\textcaption_old.txt");

            Console.WriteLine(caption.Count);
            lblStatus.Text = "Indexing....";
            Indexing.IndexFromDatabaseStorage(indexStorage, caption);

            //int numberOfJsonFiles = 3;
            //for (int i = 0; i < numberOfJsonFiles; i++)
            //{
            //    List<TextCaption> _caption = ReadTextCaptionsIndex("textcaption_" + i + ".txt");
            //    Indexing.IndexFromDatabaseStorage(indexStorage, _caption);
            //}



            lblStatus.Text = "Close IndexStorage";
            indexStorage.CloseIndexStorage();
            btnTextCaptionIndexing.Enabled = true;
        }