Package ivory.core.data.index

Examples of ivory.core.data.index.TermPositions.serialize()


    // If the int array is longer than tf, ignore the extra ints.
    tp.set(pos, (short) 5);

    assertEquals(5, tp.getTf());

    byte[] bytes = tp.serialize();
    TermPositions tp2 = TermPositions.create(bytes);

    assertEquals(5, tp2.getTf());
    int[] pos2 = tp2.getPositions();
View Full Code Here


    int[] pos = { 1, 4, 5311782, 5311783, 98921257 };
    tp.set(pos, (short) 5);

    assertEquals(5, tp.getTf());

    byte[] bytes = tp.serialize();
    TermPositions tp2 = TermPositions.create(bytes);

    assertEquals(5, tp2.getTf());
    int[] pos2 = tp2.getPositions();
View Full Code Here

    int[] pos = { 1, 4, 5, 5, 23 };

    tp.set(pos, (short) 5);
    assertEquals(5, tp.getTf());

    tp.serialize();
  }

  @Test(expected = RuntimeException.class)
  public void testIllegalPositions() throws IOException {
    TermPositions tp = new TermPositions();
View Full Code Here

    int[] pos = { 1, 4, 5, -2, -1 };

    tp.set(pos, (short) 5);
    assertEquals(5, tp.getTf());

    tp.serialize();
  }

  public static junit.framework.Test suite() {
    return new JUnit4TestAdapter(TermPositionsTest.class);
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.