예제 #1
0
 public virtual void  TestWriter()
 {
     try
     {
         TermVectorsWriter writer = new TermVectorsWriter(dir, seg, fieldInfos);
         writer.OpenDocument();
         Assert.IsTrue(writer.IsDocumentOpen() == true);
         WriteField(writer, testFields[0]);
         writer.CloseDocument();
         writer.Close();
         Assert.IsTrue(writer.IsDocumentOpen() == false);
         //Check to see the files were created
         Assert.IsTrue(dir.FileExists(seg + TermVectorsWriter.TVD_EXTENSION));
         Assert.IsTrue(dir.FileExists(seg + TermVectorsWriter.TVX_EXTENSION));
         //Now read it back in
         TermVectorsReader reader = new TermVectorsReader(dir, seg, fieldInfos);
         Assert.IsTrue(reader != null);
         CheckTermVector(reader, 0, testFields[0]);
     }
     catch (System.IO.IOException e)
     {
         System.Console.Error.WriteLine(e.StackTrace);
         Assert.IsTrue(false);
     }
 }
예제 #2
0
        private void  WriteDocument(TermVectorsWriter writer, int numFields)
        {
            writer.OpenDocument();
            Assert.IsTrue(writer.IsDocumentOpen() == true);

            for (int j = 0; j < numFields; j++)
            {
                WriteField(writer, testFields[j]);
            }
            writer.CloseDocument();
            Assert.IsTrue(writer.IsDocumentOpen() == false);
        }
예제 #3
0
 public virtual void  Test()
 {
     //Check to see the files were created properly in setup
     Assert.IsTrue(writer.IsDocumentOpen() == false);
     Assert.IsTrue(dir.FileExists(seg + TermVectorsWriter.TVD_EXTENSION));
     Assert.IsTrue(dir.FileExists(seg + TermVectorsWriter.TVX_EXTENSION));
 }
예제 #4
0
		public virtual void  TestWriter()
		{
			try
			{
				TermVectorsWriter writer = new TermVectorsWriter(dir, seg, fieldInfos);
				writer.OpenDocument();
				Assert.IsTrue(writer.IsDocumentOpen() == true);
				WriteField(writer, testFields[0]);
				writer.CloseDocument();
				writer.Close();
				Assert.IsTrue(writer.IsDocumentOpen() == false);
				//Check to see the files were created
				Assert.IsTrue(dir.FileExists(seg + TermVectorsWriter.TVD_EXTENSION));
				Assert.IsTrue(dir.FileExists(seg + TermVectorsWriter.TVX_EXTENSION));
				//Now read it back in
				TermVectorsReader reader = new TermVectorsReader(dir, seg, fieldInfos);
				Assert.IsTrue(reader != null);
				CheckTermVector(reader, 0, testFields[0]);
			}
			catch (System.IO.IOException e)
			{
				System.Console.Error.WriteLine(e.StackTrace);
				Assert.IsTrue(false);
			}
		}
예제 #5
0
		private void  WriteDocument(TermVectorsWriter writer, int numFields)
		{
			writer.OpenDocument();
			Assert.IsTrue(writer.IsDocumentOpen() == true);
			
			for (int j = 0; j < numFields; j++)
			{
				WriteField(writer, testFields[j]);
			}
			writer.CloseDocument();
			Assert.IsTrue(writer.IsDocumentOpen() == false);
		}