Examples of newHandprint()


Examples of org.rabinfingerprint.handprint.Handprints.HandPrintFactory.newHandprint()

    List<Handprint> hands = new ArrayList<Handprint>();
    HandPrintFactory factory = Handprints.newFactory(p);
    for (File file : files) {
      if (!file.isFile())
        continue;
      hands.add(factory.newHandprint(new FileInputStream(file)));
    }

    return hands;
  }
}
View Full Code Here

Examples of org.rabinfingerprint.handprint.Handprints.HandPrintFactory.newHandprint()

    System.out.println(String.format("%X", rabin.getFingerprintLong()));
  }

  public void handprintStdin(Polynomial p) throws IOException {
    HandPrintFactory factory = Handprints.newFactory(p);
    Handprint hand = factory.newHandprint(System.in);
    for (Long finger : hand.getHandFingers().keySet()) {
      System.out.println(String.format("%X", finger));
    }
  }
View Full Code Here

Examples of org.rabinfingerprint.handprint.Handprints.HandPrintFactory.newHandprint()

  public void handprintFiles(List<String> paths, Polynomial p) throws IOException {
    HandPrintFactory factory = Handprints.newFactory(p);
    for (String path : paths) {
      File file = new File(path);
      if (file.exists()) {
        Handprint hand = factory.newHandprint(new FileInputStream(file));
        for (Long finger : hand.getHandFingers().keySet()) {
          System.out.println(String.format("%X", finger));
        }
        System.out.flush();
      } else {
View Full Code Here

Examples of org.rabinfingerprint.handprint.Handprints.HandPrintFactory.newHandprint()

  public void testChunkingFiles() throws IOException {
    Polynomial p = Polynomial.createIrreducible(53);
   
    List<InputStream> sims = TestDataGenerator.getSimilarRandomBytes(4);
    HandPrintFactory factory = Handprints.newFactory(p);
    Handprint hand1 = factory.newHandprint(sims.get(0));
    Handprint hand2 = factory.newHandprint(sims.get(1));
    Handprint hand3 = factory.newHandprint(sims.get(2));
    Handprint hand4 = factory.newHandprint(sims.get(3));

    assertTrue(Math.abs(0.70 - hand1.getSimilarity(hand2)) < 0.05);
View Full Code Here

Examples of org.rabinfingerprint.handprint.Handprints.HandPrintFactory.newHandprint()

    Polynomial p = Polynomial.createIrreducible(53);
   
    List<InputStream> sims = TestDataGenerator.getSimilarRandomBytes(4);
    HandPrintFactory factory = Handprints.newFactory(p);
    Handprint hand1 = factory.newHandprint(sims.get(0));
    Handprint hand2 = factory.newHandprint(sims.get(1));
    Handprint hand3 = factory.newHandprint(sims.get(2));
    Handprint hand4 = factory.newHandprint(sims.get(3));

    assertTrue(Math.abs(0.70 - hand1.getSimilarity(hand2)) < 0.05);
    assertTrue(Math.abs(0.70 - hand1.getSimilarity(hand3)) < 0.05);
View Full Code Here

Examples of org.rabinfingerprint.handprint.Handprints.HandPrintFactory.newHandprint()

   
    List<InputStream> sims = TestDataGenerator.getSimilarRandomBytes(4);
    HandPrintFactory factory = Handprints.newFactory(p);
    Handprint hand1 = factory.newHandprint(sims.get(0));
    Handprint hand2 = factory.newHandprint(sims.get(1));
    Handprint hand3 = factory.newHandprint(sims.get(2));
    Handprint hand4 = factory.newHandprint(sims.get(3));

    assertTrue(Math.abs(0.70 - hand1.getSimilarity(hand2)) < 0.05);
    assertTrue(Math.abs(0.70 - hand1.getSimilarity(hand3)) < 0.05);
    assertTrue(Math.abs(0.70 - hand1.getSimilarity(hand4)) < 0.05);
View Full Code Here

Examples of org.rabinfingerprint.handprint.Handprints.HandPrintFactory.newHandprint()

    List<InputStream> sims = TestDataGenerator.getSimilarRandomBytes(4);
    HandPrintFactory factory = Handprints.newFactory(p);
    Handprint hand1 = factory.newHandprint(sims.get(0));
    Handprint hand2 = factory.newHandprint(sims.get(1));
    Handprint hand3 = factory.newHandprint(sims.get(2));
    Handprint hand4 = factory.newHandprint(sims.get(3));

    assertTrue(Math.abs(0.70 - hand1.getSimilarity(hand2)) < 0.05);
    assertTrue(Math.abs(0.70 - hand1.getSimilarity(hand3)) < 0.05);
    assertTrue(Math.abs(0.70 - hand1.getSimilarity(hand4)) < 0.05);
   
View Full Code Here

Examples of org.rabinfingerprint.handprint.Handprints.HandPrintFactory.newHandprint()

    assertTrue(Math.abs(0.70 - hand1.getSimilarity(hand2)) < 0.05);
    assertTrue(Math.abs(0.70 - hand1.getSimilarity(hand3)) < 0.05);
    assertTrue(Math.abs(0.70 - hand1.getSimilarity(hand4)) < 0.05);
   
    List<InputStream> diffs = TestDataGenerator.getDifferentRandomBytes(3);
    Handprint hand5 = factory.newHandprint(diffs.get(0));
    Handprint hand6 = factory.newHandprint(diffs.get(1));
    Handprint hand7 = factory.newHandprint(diffs.get(2));

    assertTrue(Math.abs(0.00 - hand1.getSimilarity(hand5)) < 0.05);
    assertTrue(Math.abs(0.00 - hand1.getSimilarity(hand6)) < 0.05);
View Full Code Here

Examples of org.rabinfingerprint.handprint.Handprints.HandPrintFactory.newHandprint()

    assertTrue(Math.abs(0.70 - hand1.getSimilarity(hand3)) < 0.05);
    assertTrue(Math.abs(0.70 - hand1.getSimilarity(hand4)) < 0.05);
   
    List<InputStream> diffs = TestDataGenerator.getDifferentRandomBytes(3);
    Handprint hand5 = factory.newHandprint(diffs.get(0));
    Handprint hand6 = factory.newHandprint(diffs.get(1));
    Handprint hand7 = factory.newHandprint(diffs.get(2));

    assertTrue(Math.abs(0.00 - hand1.getSimilarity(hand5)) < 0.05);
    assertTrue(Math.abs(0.00 - hand1.getSimilarity(hand6)) < 0.05);
    assertTrue(Math.abs(0.00 - hand1.getSimilarity(hand7)) < 0.05);
View Full Code Here

Examples of org.rabinfingerprint.handprint.Handprints.HandPrintFactory.newHandprint()

    assertTrue(Math.abs(0.70 - hand1.getSimilarity(hand4)) < 0.05);
   
    List<InputStream> diffs = TestDataGenerator.getDifferentRandomBytes(3);
    Handprint hand5 = factory.newHandprint(diffs.get(0));
    Handprint hand6 = factory.newHandprint(diffs.get(1));
    Handprint hand7 = factory.newHandprint(diffs.get(2));

    assertTrue(Math.abs(0.00 - hand1.getSimilarity(hand5)) < 0.05);
    assertTrue(Math.abs(0.00 - hand1.getSimilarity(hand6)) < 0.05);
    assertTrue(Math.abs(0.00 - hand1.getSimilarity(hand7)) < 0.05);
  }
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.