public Searcher(string containerFileName, string indexFileName)
        {
            this.DefaultContainer = Container.GetContainer(containerFileName);
            this.DefaultIndex = new Index(indexFileName);

            IEnumerable<Livro> livros = from Livro l in DefaultContainer
                                        select l;
            this.sbItemSuggest = new SimpleSbItemSuggester(livros, ActivateSbItem);
        }
示例#2
0
        public Program()
        {
            Index i = new Index(@"..\..\..\SpokenBible\Data\deutsch.yap");
            i.CreateIndex(@"..\..\..\SpokenBible\Data\deutsch");
            Console.Write("foi!!!");
            Console.ReadKey();
            return;

            string arquivoIn = @"..\..\..\..\Files\Translations\pt_BR\ra.txt";
            string arquivoOut = @"..\..\..\SpokenBible\Data\database.yap";
            
            Console.WriteLine("--- SpokenBible: file.txt to SpokenBible DataBase file converter ---");

            File.Delete(arquivoOut);
            StreamReader sr = new StreamReader(arquivoIn);
            TxtParser parser = new TxtParser();
            parser.OnTraducaoFound = new TxtParser.TokenFound<Traducao>(this.traducaoFound);
            parser.OnTestamentoFound = new TxtParser.TokenFound<Testamento>(this.testamentoFound);
            parser.OnLivroFound = new TxtParser.TokenFound<Livro>(this.livroFound);
            parser.OnCapituloFound = new TxtParser.TokenFound<Capitulo>(this.capituloFound);
            parser.OnVersiculoFound = new TxtParser.TokenFound<Versiculo>(this.versiculoFound);

            string linha;
            while ((linha = sr.ReadLine()) != null)
            {
                parser.parse(linha);
            }

            sr.Close();

            Console.WriteLine("Txt to Object conversion finalized.");

            IObjectContainer container = Container.GetContainer(arquivoOut);
            container.Store(currentTraducao);
            Container.CloseContainer();

            Console.WriteLine("Database created.");

            Console.ReadKey();
        }