Exemplo n.º 1
0
 @Test
 public void testSome() {
   builder.add(1, 3.5);
   builder.add(3, 5.2);
   builder.add(-1, 0.2);
   MutableSparseVector vec = Vectors.fromScoredIds(builder.finish());
   assertThat(vec.size(), equalTo(3));
   assertThat(vec.get(1), equalTo(3.5));
   assertThat(vec.get(3), equalTo(5.2));
   assertThat(vec.get(-1), equalTo(0.2));
 }
Exemplo n.º 2
0
 @Test
 public void testSingleton() {
   builder.add(1, 3.5);
   MutableSparseVector vec = Vectors.fromScoredIds(builder.finish());
   assertThat(vec.size(), equalTo(1));
   assertThat(vec.get(1), equalTo(3.5));
 }