Package cc.mallet.types

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


    fs.add (dict.lookupIndex ("d"));
    fs.add (dict.lookupIndex ("r"));
    fs.add (dict.lookupIndex ("e"));
    fs.add (dict.lookupIndex ("w"));
    fs.add (dict.lookupIndex ("m"));
    fs.add (dict.lookupIndex ("c"));
    fs.add (dict.lookupIndex ("c"));
    fs.add (dict.lookupIndex ("a"));
    fs.add (dict.lookupIndex ("l"));
    fs.add (dict.lookupIndex ("l"));
    fs.add (dict.lookupIndex ("u"));
View Full Code Here


    fs.add (dict.lookupIndex ("r"));
    fs.add (dict.lookupIndex ("e"));
    fs.add (dict.lookupIndex ("w"));
    fs.add (dict.lookupIndex ("m"));
    fs.add (dict.lookupIndex ("c"));
    fs.add (dict.lookupIndex ("c"));
    fs.add (dict.lookupIndex ("a"));
    fs.add (dict.lookupIndex ("l"));
    fs.add (dict.lookupIndex ("l"));
    fs.add (dict.lookupIndex ("u"));
    fs.add (dict.lookupIndex ("m"));
View Full Code Here

    fs.add (dict.lookupIndex ("e"));
    fs.add (dict.lookupIndex ("w"));
    fs.add (dict.lookupIndex ("m"));
    fs.add (dict.lookupIndex ("c"));
    fs.add (dict.lookupIndex ("c"));
    fs.add (dict.lookupIndex ("a"));
    fs.add (dict.lookupIndex ("l"));
    fs.add (dict.lookupIndex ("l"));
    fs.add (dict.lookupIndex ("u"));
    fs.add (dict.lookupIndex ("m"));
    //System.out.println (fs.toString());
View Full Code Here

    fs.add (dict.lookupIndex ("w"));
    fs.add (dict.lookupIndex ("m"));
    fs.add (dict.lookupIndex ("c"));
    fs.add (dict.lookupIndex ("c"));
    fs.add (dict.lookupIndex ("a"));
    fs.add (dict.lookupIndex ("l"));
    fs.add (dict.lookupIndex ("l"));
    fs.add (dict.lookupIndex ("u"));
    fs.add (dict.lookupIndex ("m"));
    //System.out.println (fs.toString());
    e.increment (fs);
View Full Code Here

    fs.add (dict.lookupIndex ("m"));
    fs.add (dict.lookupIndex ("c"));
    fs.add (dict.lookupIndex ("c"));
    fs.add (dict.lookupIndex ("a"));
    fs.add (dict.lookupIndex ("l"));
    fs.add (dict.lookupIndex ("l"));
    fs.add (dict.lookupIndex ("u"));
    fs.add (dict.lookupIndex ("m"));
    //System.out.println (fs.toString());
    e.increment (fs);
    assertTrue (e.size() == 10);
View Full Code Here

    fs.add (dict.lookupIndex ("c"));
    fs.add (dict.lookupIndex ("c"));
    fs.add (dict.lookupIndex ("a"));
    fs.add (dict.lookupIndex ("l"));
    fs.add (dict.lookupIndex ("l"));
    fs.add (dict.lookupIndex ("u"));
    fs.add (dict.lookupIndex ("m"));
    //System.out.println (fs.toString());
    e.increment (fs);
    assertTrue (e.size() == 10);
View Full Code Here

    fs.add (dict.lookupIndex ("c"));
    fs.add (dict.lookupIndex ("a"));
    fs.add (dict.lookupIndex ("l"));
    fs.add (dict.lookupIndex ("l"));
    fs.add (dict.lookupIndex ("u"));
    fs.add (dict.lookupIndex ("m"));
    //System.out.println (fs.toString());
    e.increment (fs);
    assertTrue (e.size() == 10);

    Multinomial m = e.estimate ();
View Full Code Here

    e.increment (fs);
    assertTrue (e.size() == 10);

    Multinomial m = e.estimate ();
    assertTrue (m.size() == 10);
    assertTrue (m.probability (dict.lookupIndex ("a")) == (2.0+1)/(14.0+10));
    assertTrue (m.probability ("w") == (1.0+1)/(14.0+10));
    Multinomial.Logged ml = new Multinomial.Logged (m);
    assertTrue (m.logProbability ("w") == ml.logProbability ("w"));
  }
View Full Code Here

  private static Alphabet dictOfSize (int size)
  {
    Alphabet ret = new Alphabet ();
    for (int i = 0; i < size; i++)
      ret.lookupIndex ("feature"+i);
    return ret;
  }

  public void testRandomTrained ()
  {
View Full Code Here

    t.setFeatureValue ("in /usr/dict/words", 0);

    Alphabet dict = new Alphabet();
    FeatureVector fv = t.toFeatureVector (dict, false);
    assertTrue (fv.numLocations() == 2);
    assertTrue (fv.value (dict.lookupIndex("length")) == 3);
  }

  public void testTwo ()
  {
    try {
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.