@Repeat(iterations = 10) @Test public void testNoTargetLeakage() { String body = randomText(10, 2000, 2, 100);; String title = randomText(10, 2000, 2, 100);; Set<String> tags = Sets.newHashSet(randomText(10, 2000, 1, 1)); double reputation = randomDouble(); Document firstDoc = Document.of(body, "first", title, reputation, tags); Document secondDoc = Document.of(body, "second", title, reputation, tags); Vectoriser vectorise = new Vectoriser(); Vector first = vectorise.vectorise(firstDoc); Vector second = vectorise.vectorise(secondDoc); assertEquals("The state field should not be taken into consideration when creating vectors.", first, second); }
public Vector vectorise(Document document) { Vector body = luceneEncode(bodyCard, document.getBody()); Vector title = luceneEncode(titleCard, document.getTitle()); return Vectors.append(body, title); }
Vectoriser { public Vector vectorise(Document document) { Vector body = luceneEncode(bodyCard, document.getBody()); Vector title = luceneEncode(titleCard, document.getTitle()); return Vectors.append(body, title); } }
Vectoriser { public Vector vectorise(Document document) { Vector body = luceneEncode(bodyCard, document.getBody()); Vector title = luceneEncode(titleCard, document.getTitle()); return Vectors.append(body, title); }  }
Vectoriser { public Vector vectorise(Document document) { Vector body = luceneEncode(bodyCard, document.getBody()); Vector title = luceneEncode(titleCard, document.getTitle()); return Vectors.append(body, title); }  static int getCardinality(); Vector vectorise(Document document); }
Vectoriser { public Vector vectorise(Document document) { Vector body = luceneEncode(bodyCard, document.getBody()); Vector title = luceneEncode(titleCard, document.getTitle()); return Vectors.append(body, title); }  static int getCardinality(); Vector vectorise(Document document); static final int bodyCard; static final int titleCard; }