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(); }
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(); }