Package cc.mallet.types

Examples of cc.mallet.types.Alphabet.lookupIndex()


  }

  public void testNotFound ()
  {
    Alphabet dict = new Alphabet ();
    dict.lookupIndex ("TEST1");
    dict.lookupIndex ("TEST2");
    dict.lookupIndex ("TEST3");
    assertEquals (-1, dict.lookupIndex ("TEST4", false));
    assertEquals (3, dict.size());
    assertEquals (3, dict.lookupIndex ("TEST4", true));
View Full Code Here


  public void testNotFound ()
  {
    Alphabet dict = new Alphabet ();
    dict.lookupIndex ("TEST1");
    dict.lookupIndex ("TEST2");
    dict.lookupIndex ("TEST3");
    assertEquals (-1, dict.lookupIndex ("TEST4", false));
    assertEquals (3, dict.size());
    assertEquals (3, dict.lookupIndex ("TEST4", true));
  }
View Full Code Here

  public void testNotFound ()
  {
    Alphabet dict = new Alphabet ();
    dict.lookupIndex ("TEST1");
    dict.lookupIndex ("TEST2");
    dict.lookupIndex ("TEST3");
    assertEquals (-1, dict.lookupIndex ("TEST4", false));
    assertEquals (3, dict.size());
    assertEquals (3, dict.lookupIndex ("TEST4", true));
  }
View Full Code Here

  {
    Alphabet dict = new Alphabet ();
    dict.lookupIndex ("TEST1");
    dict.lookupIndex ("TEST2");
    dict.lookupIndex ("TEST3");
    assertEquals (-1, dict.lookupIndex ("TEST4", false));
    assertEquals (3, dict.size());
    assertEquals (3, dict.lookupIndex ("TEST4", true));
  }

  // tests a bug where
View Full Code Here

    dict.lookupIndex ("TEST1");
    dict.lookupIndex ("TEST2");
    dict.lookupIndex ("TEST3");
    assertEquals (-1, dict.lookupIndex ("TEST4", false));
    assertEquals (3, dict.size());
    assertEquals (3, dict.lookupIndex ("TEST4", true));
  }

  // tests a bug where
  public void testReadResolve () throws IOException, ClassNotFoundException
  {
View Full Code Here

  // tests a bug where
  public void testReadResolve () throws IOException, ClassNotFoundException
  {
    Alphabet dict = new Alphabet ();
    dict.lookupIndex ("TEST1");
    dict.lookupIndex ("TEST2");
    dict.lookupIndex ("TEST3");
    Alphabet dict2 = (Alphabet) TestSerializable.cloneViaSerialization (dict);
    assertTrue (dict == dict2);
  }
View Full Code Here

  // tests a bug where
  public void testReadResolve () throws IOException, ClassNotFoundException
  {
    Alphabet dict = new Alphabet ();
    dict.lookupIndex ("TEST1");
    dict.lookupIndex ("TEST2");
    dict.lookupIndex ("TEST3");
    Alphabet dict2 = (Alphabet) TestSerializable.cloneViaSerialization (dict);
    assertTrue (dict == dict2);
  }
View Full Code Here

  public void testReadResolve () throws IOException, ClassNotFoundException
  {
    Alphabet dict = new Alphabet ();
    dict.lookupIndex ("TEST1");
    dict.lookupIndex ("TEST2");
    dict.lookupIndex ("TEST3");
    Alphabet dict2 = (Alphabet) TestSerializable.cloneViaSerialization (dict);
    assertTrue (dict == dict2);
  }

  public static Test suite ()
View Full Code Here

          target.add(tokens[l][nFeatures]);
        }
        else nFeatures = tokens[l].length;
        ArrayList<Integer> featureIndices = new ArrayList<Integer>();
        for (int f = 0; f < nFeatures; f++) {
          int featureIndex = features.lookupIndex(tokens[l][f]);
          // gdruck
          // If the data alphabet's growth is stopped, featureIndex
          // will be -1.  Ignore these features.
          if (featureIndex >= 0) {
            featureIndices.add(featureIndex);
View Full Code Here

          target.add(tokens[l][nFeatures]);
        }
        else nFeatures = tokens[l].length;
        ArrayList<Integer> featureIndices = new ArrayList<Integer>();
        for (int f = 0; f < nFeatures; f++) {
          int featureIndex = features.lookupIndex(tokens[l][f]);
          // gdruck
          // If the data alphabet's growth is stopped, featureIndex
          // will be -1.  Ignore these features.
          if (featureIndex >= 0) {
            featureIndices.add(featureIndex);
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.