Examples of lookupIndex()


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

   *   This currently fails.  I'm not sure what to do about this. -cas
   */
  public void testReadResolve () throws IOException, ClassNotFoundException
  {
    LabelAlphabet dict = new LabelAlphabet ();
    dict.lookupIndex ("TEST1");
    dict.lookupIndex ("TEST2");
    dict.lookupIndex ("TEST3");


    Label t1 = dict.lookupLabel ("TEST1");
View Full Code Here

Examples of org.fnlp.ml.types.alphabet.HashFeatureAlphabet.lookupIndex()

        sw[j] = weights[base+j];
      }
      float var = MyArrays.viarance(sw);
      if (var>varsthresh) {
        int str = index.get(base);
        int id = newfeat.lookupIndex(str, interv);
        for (int j = 0; j < interv; j++) {
          ww.insert(id + j, weights[base + j]);
        }
      }else{
        //        System.out.print("."); 
View Full Code Here

Examples of org.fnlp.ml.types.alphabet.IFeatureAlphabet.lookupIndex()

      } else {
        e2 = null;
        key2 = nIndex;
      }
     
      int ofs = features.lookupIndex(v1, key2-key1);
      e1 = e2;
      System.out.print(key1);
      System.out.print('\t');
      System.out.print(ofs);
      System.out.print('\t');
View Full Code Here

Examples of org.fnlp.ml.types.alphabet.LabelAlphabet.lookupIndex()

    s = rd.readLine();          //#label
    int nLabel = Integer.parseInt(s);
    System.out.println(nLabel);
    for(int i=0; i<nLabel; i++) {
      s = rd.readLine();        //label
      labels.lookupIndex(s);
    }
    out.writeObject(labels);
    rd.readLine();            //blank line
    rd.readLine();            //#column
    rd.readLine();            //blank line
View Full Code Here

Examples of org.fnlp.ml.types.alphabet.StringFeatureAlphabet.lookupIndex()

        maxe[iii]=1;
      }
      float maxen = MyArrays.entropy(maxe);
      if (i==0||vars[i]>varsthresh&&entropy[i]<maxen*0.999) {
        String str = index.get(base);
        int id = newfeat.lookupIndex(str, interv);
        for (int j = 0; j < interv; j++) {
          ww.insert(id + j, weights[base + j]);
        }
      }else{
//                System.out.print("."); 
View Full Code Here

Examples of types.Alphabet.lookupIndex()

      for (int i = 0; i < labels.length; i++) {

        // add the labels as new annotation features
        if (iterator.hasNext())
          iterator.next().getFeatures().put(labelType,
              labelAlphabet.lookupIndex(labels[i]));

        // shouldn't happen, but who knows?
        else
          System.err
          .println("Unexpected number of tokens in sentence!");
View Full Code Here

Examples of upenn.junto.util.RyanAlphabet.lookupIndex()

      BufferedWriter seedWriter =
        new BufferedWriter(new FileWriter(graphOutputFile + ".seed_vertices"));

      RyanAlphabet alpha = new RyanAlphabet();
      // we would like to avoid 0 as the index
      alpha.lookupIndex("", true);
     
      Iterator<String> vIter = _vertices.keySet().iterator();     
      while (vIter.hasNext()) {
        String vName = vIter.next();
        int vIdx = alpha.lookupIndex(vName, true);
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.