Package cc.mallet.util

Examples of cc.mallet.util.PropertyList$ObjectIterator


    TokenSequence ts = (TokenSequence) carrier.getData();
    int tsSize = ts.size();
    PropertyList[] newFeatures = new PropertyList[tsSize];
    for (int i = 0; i < tsSize; i++) {
      Token t = ts.get (i);
      PropertyList pl = t.getFeatures();
      newFeatures[i] = pl;
      for (int position = i + leftBoundary; position < i + rightBoundary; position++) {
        if (position == i && !includeCurrentToken)
          continue;
        PropertyList pl2;
        if (position < 0)
          pl2 = startfs[-position];
        else if (position >= tsSize)
          pl2 = endfs[position-tsSize];
        else
          pl2 = ts.get(position).getFeatures ();
        PropertyList.Iterator pl2i = pl2.iterator();
        while (pl2i.hasNext()) {
          pl2i.next();
          String key = pl2i.getKey();
          if (featureRegex == null || featureRegex.matcher(key).matches()) {
            newFeatures[i] = PropertyList.add ((namePrefixLeft == null || position-i>0 ? namePrefix : namePrefixLeft)+key,
View Full Code Here


    super (name);
  }
 
  public void testOne ()
  {
    PropertyList pl = null;
    pl = PropertyList.add ("one", 1.0, pl);
    pl = PropertyList.add ("two", 2.0, pl);
    pl = PropertyList.add ("three", 3, pl);

    assertTrue (pl.lookupNumber("one") == 1.0);
    pl = PropertyList.remove ("three", pl);
    assertTrue (pl.lookupNumber("three") == 0.0);
   
    pl = PropertyList.add ("color", "red", pl);
    assertTrue (pl.lookupObject("color").equals("red"));
  }
View Full Code Here

            }
          }
        }
      }

      PropertyList pl = null;
      if (match)
        pl = PropertyList.add("Match", 1.0, pl);
      else
        pl = PropertyList.add("NoMatch", 1.0, pl);
     
View Full Code Here

  }
 
  public Instance pipe (Instance carrier)
  {
    Classification classification = (Classification) carrier.getData();
    PropertyList features = null;
    LabelVector lv = classification.getLabelVector();
    Label bestLabel = lv.getBestLabel();
    Instance inst = (Instance)classification.getInstance();
    FeatureVector fv = (FeatureVector)inst.getData();
    Alphabet fdict = fv.getAlphabet();
View Full Code Here

      int[] mergedIndices = neighbor.getNewCluster();
      Record[] records = array2Records(mergedIndices, list);
      Alphabet fieldAlph = records[0].fieldAlphabet();
      Alphabet valueAlph = records[0].valueAlphabet();

      PropertyList features = null;
      features = addExactMatch(records, fieldAlph, valueAlph, features);
      features = addApproxMatch(records, fieldAlph, valueAlph, features);
      features = addSubstringMatch(records, fieldAlph, valueAlph, features);
      carrier
          .setData(new FeatureVector(getDataAlphabet(), features,
View Full Code Here

TOP

Related Classes of cc.mallet.util.PropertyList$ObjectIterator

Copyright © 2018 www.massapicom. 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.