Examples of toStringId()


Examples of org.apache.mahout.cf.taste.model.IDMigrator.toStringID()

  public void testRefreshAfterFileUpdate() throws Exception {
    IDMigrator migrator = new FileIDMigrator(testFile, 0L);

    /* call a method to make sure the original file is loaded */
    long dogAsLong = migrator.toLongID("dog");
    migrator.toStringID(dogAsLong);

    /* change the underlying file,
     * we have to wait at least a second to see the change in the file's lastModified timestamp */
    Thread.sleep(2000L);
    writeLines(testFile, UPDATED_STRING_IDS);
View Full Code Here

Examples of org.apache.mahout.cf.taste.model.IDMigrator.toStringID()

    migrator.refresh(null);

    long cowAsLong = migrator.toLongID("cow");
    long donkeyAsLong = migrator.toLongID("donkey");
    assertEquals("dog", migrator.toStringID(dogAsLong));
    assertEquals("cow", migrator.toStringID(cowAsLong));
    assertEquals("donkey", migrator.toStringID(donkeyAsLong));
  }
}
View Full Code Here

Examples of org.apache.mahout.cf.taste.model.IDMigrator.toStringID()

    migrator.refresh(null);

    long cowAsLong = migrator.toLongID("cow");
    long donkeyAsLong = migrator.toLongID("donkey");
    assertEquals("dog", migrator.toStringID(dogAsLong));
    assertEquals("cow", migrator.toStringID(cowAsLong));
    assertEquals("donkey", migrator.toStringID(donkeyAsLong));
  }
}
View Full Code Here

Examples of org.apache.mahout.cf.taste.model.IDMigrator.toStringID()

    long cowAsLong = migrator.toLongID("cow");
    long donkeyAsLong = migrator.toLongID("donkey");
    assertEquals("dog", migrator.toStringID(dogAsLong));
    assertEquals("cow", migrator.toStringID(cowAsLong));
    assertEquals("donkey", migrator.toStringID(donkeyAsLong));
  }
}
View Full Code Here

Examples of org.apache.mahout.cf.taste.model.IDMigrator.toStringID()

  }

  @Test(expected = UnsupportedOperationException.class)
  public void testBackward() throws Exception {
    IDMigrator migrator = new OneWayMigrator();
    migrator.toStringID(0L);
  }

}
View Full Code Here

Examples of org.apache.mahout.cf.taste.model.UpdatableIDMigrator.toStringID()

  @Test
  public void testStore() throws Exception {
    UpdatableIDMigrator migrator = new MemoryIDMigrator();
    long id = migrator.toLongID(DUMMY_STRING);
    assertNull(migrator.toStringID(id));
    migrator.storeMapping(id, DUMMY_STRING);
    assertEquals(DUMMY_STRING, migrator.toStringID(id));
  }

  @Test
View Full Code Here

Examples of org.apache.mahout.cf.taste.model.UpdatableIDMigrator.toStringID()

  public void testStore() throws Exception {
    UpdatableIDMigrator migrator = new MemoryIDMigrator();
    long id = migrator.toLongID(DUMMY_STRING);
    assertNull(migrator.toStringID(id));
    migrator.storeMapping(id, DUMMY_STRING);
    assertEquals(DUMMY_STRING, migrator.toStringID(id));
  }

  @Test
  public void testInitialize() throws Exception {
    UpdatableIDMigrator migrator = new MemoryIDMigrator();
View Full Code Here

Examples of org.apache.mahout.cf.taste.model.UpdatableIDMigrator.toStringID()

  @Test
  public void testInitialize() throws Exception {
    UpdatableIDMigrator migrator = new MemoryIDMigrator();
    long id = migrator.toLongID(DUMMY_STRING);
    assertNull(migrator.toStringID(id));
    migrator.initialize(Collections.singleton(DUMMY_STRING));
    assertEquals(DUMMY_STRING, migrator.toStringID(id));
  }

}
View Full Code Here

Examples of org.apache.mahout.cf.taste.model.UpdatableIDMigrator.toStringID()

  public void testInitialize() throws Exception {
    UpdatableIDMigrator migrator = new MemoryIDMigrator();
    long id = migrator.toLongID(DUMMY_STRING);
    assertNull(migrator.toStringID(id));
    migrator.initialize(Collections.singleton(DUMMY_STRING));
    assertEquals(DUMMY_STRING, migrator.toStringID(id));
  }

}
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLAnonymousIndividual.toStringID()

                } else if (val instanceof OWLLiteral) {
                    OWLLiteral lit = (OWLLiteral) val;
                    return lit.getLiteral();
                } else if (val instanceof OWLAnonymousIndividual) {
                    OWLAnonymousIndividual ind = (OWLAnonymousIndividual) val;
                    return ind.toStringID();
                } else {
                    throw new RuntimeException("Unexpected class "
                            + val.getClass());
                }
            }
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.