Package classes

Examples of classes.NBestList.addResult()


  @Test
  public void testNames() {
    try {
      NBestList n = new NBestList();
      n.addResult("r1", 2, 2, 2);
      n.addResult("r2", 22, 222, 23);
      if (!(n.getNames()[0].equals("r1") && n.getNames()[1].equals("r2")))
        fail("Names() not working as expected!");
    }
    catch (Exception e) {
      fail("Names() not working, due to exceptions: " + e.getMessage());
View Full Code Here


 
  @Test
  public void testNameString() {
    try {
      NBestList n = new NBestList();
      n.addResult("r1", 2, 2, 2);
      n.addResult("r2", 22, 222, 23);
      String s = n.getNamesString();
      if (!(s.equals("r1,r2")))
        fail("NameString() not working as expected!");
    }
View Full Code Here

  @Test
  public void testNameString() {
    try {
      NBestList n = new NBestList();
      n.addResult("r1", 2, 2, 2);
      n.addResult("r2", 22, 222, 23);
      String s = n.getNamesString();
      if (!(s.equals("r1,r2")))
        fail("NameString() not working as expected!");
    }
    catch (Exception e) {
View Full Code Here

 
  @Test
  public void testScores() {
    try {
      NBestList n = new NBestList();
      n.addResult("r1", 2, 2, 2);
      n.addResult("r2", 22, 22, 22);
      double[] d = n.getScores();
      if (d == null)
        return;
      if (d[0] != 2 && d[1] != 22)
View Full Code Here

  @Test
  public void testScores() {
    try {
      NBestList n = new NBestList();
      n.addResult("r1", 2, 2, 2);
      n.addResult("r2", 22, 22, 22);
      double[] d = n.getScores();
      if (d == null)
        return;
      if (d[0] != 2 && d[1] != 22)
        fail("Scores() not working as expected!");
View Full Code Here

 
  @Test
  public void testScoresString() {
    try {
      NBestList n = new NBestList();
      n.addResult("r1", 2, 2, 2);
      n.addResult("r2", 22, 222, 23);
      if (!(n.getScoresString().equals("2,22")))
        fail("ScoresString() not working as expected!");
    }
    catch (Exception e) {
View Full Code Here

  @Test
  public void testScoresString() {
    try {
      NBestList n = new NBestList();
      n.addResult("r1", 2, 2, 2);
      n.addResult("r2", 22, 222, 23);
      if (!(n.getScoresString().equals("2,22")))
        fail("ScoresString() not working as expected!");
    }
    catch (Exception e) {
      fail("ScoresString() not working, due to exceptions: "
View Full Code Here

 
  @Test
  public void testGet() {
    try {
      NBestList n = new NBestList();
      n.addResult("r1", 2, 2, 2);
      n.addResult("r2", 22, 222, 23);
      if (!(n.get(0).getName().equals("r1")))
        fail("get() not working as expected!");
    }
    catch (Exception e) {
View Full Code Here

  @Test
  public void testGet() {
    try {
      NBestList n = new NBestList();
      n.addResult("r1", 2, 2, 2);
      n.addResult("r2", 22, 222, 23);
      if (!(n.get(0).getName().equals("r1")))
        fail("get() not working as expected!");
    }
    catch (Exception e) {
      fail("get() not working, due to exceptions: " + e.getMessage());
View Full Code Here

 
  @Test
  public void testGetLessThanZero() {
    try {
      NBestList n = new NBestList();
      n.addResult("r1", 2, 2, 2);
      n.addResult("r2", 22, 222, 23);
      if (!(n.get(-1) == null))
        fail("get() not working as expected!");
    }
    catch (Exception e) {
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.