Examples of ArrayIterator


Examples of cc.mallet.pipe.iterator.ArrayIterator

  public void testSpaceSerializable () throws IOException, ClassNotFoundException
  {
    Pipe p = makeSpacePredictionPipe ();
    InstanceList training = new InstanceList (p);
    training.addThruPipe (new ArrayIterator (data));

    MEMM memm = new MEMM (p, null);
    memm.addFullyConnectedStatesForLabels ();
    memm.addStartState();
    memm.setWeightsDimensionAsIn(training);
View Full Code Here

Examples of cc.mallet.pipe.iterator.ArrayIterator

  {
    Pipe p = makeSpacePredictionPipe ();
    Pipe p2 = new TestMEMM2String();

    InstanceList instances = new InstanceList(p);
    instances.addThruPipe(new ArrayIterator(data));
    InstanceList[] lists = instances.split(new double[]{.5, .5});
    MEMM memm = new MEMM(p, p2);
    memm.addFullyConnectedStatesForLabels();
    memm.setWeightsDimensionAsIn(lists[0]);
   
View Full Code Here

Examples of cc.mallet.pipe.iterator.ArrayIterator

    Pipe p = makeSpacePredictionPipe ();

    MEMM savedCRF;
    File f = new File("TestObject.obj");
    InstanceList instances = new InstanceList(p);
    instances.addThruPipe(new ArrayIterator(data));
    InstanceList[] lists = instances.split(new double[]{.5, .5});
    MEMM crf = new MEMM(p.getDataAlphabet(), p.getTargetAlphabet());
    crf.addFullyConnectedStatesForLabels();
    if (useSparseWeights)
      crf.setWeightsDimensionAsIn(lists[0]);
View Full Code Here

Examples of cc.mallet.pipe.iterator.ArrayIterator

  public void disabledtestAddOrderNStates ()
  {
    Pipe p = makeSpacePredictionPipe ();

    InstanceList instances = new InstanceList (p);
    instances.addThruPipe (new ArrayIterator(data));
    InstanceList[] lists = instances.split (new java.util.Random (678), new double[]{.5, .5});

    // Compare 3 CRFs trained with addOrderNStates, and make sure
    // that having more features leads to a higher likelihood
View Full Code Here

Examples of cc.mallet.pipe.iterator.ArrayIterator

       new TokenSequence2FeatureVectorSequence(),
       new PrintInputAndTarget(),
    });
    InstanceList one = new InstanceList (p);
    String[] data = new String[] { "ABCDE", };
    one.addThruPipe (new ArrayIterator (data));
    MEMM crf = new MEMM (p, null);
    crf.addFullyConnectedStatesForLabels();
    crf.setWeightsDimensionAsIn (one);
    MEMMTrainer memmt = new MEMMTrainer (crf);
    MEMMTrainer.MEMMOptimizableByLabelLikelihood mcrf = memmt.getOptimizableMEMM(one);
View Full Code Here

Examples of client.net.sf.saxon.ce.tree.iter.ArrayIterator

        } else {
            StringValue[] groups = new StringValue[c];
            for (int i=1; i<=groups.length; i++) {
                groups[i-1] = StringValue.makeStringValue(matcher.getParen(i).toString());
            }
            return new ArrayIterator(groups);
        }
    }
View Full Code Here

Examples of client.net.sf.saxon.ce.tree.iter.ArrayIterator

     * @return the required SequenceIterator, positioned at the start of the
     *     sequence
     */

    public SequenceIterator iterate() {
        return new ArrayIterator(value, start, end);
    }
View Full Code Here

Examples of client.net.sf.saxon.ce.tree.iter.ArrayIterator

                state = EMPTY;
                return EmptyIterator.getInstance();
            case 1:
                return SingletonIterator.makeIterator(reservoir[0]);
            default:
                return new ArrayIterator(reservoir, 0, used);
            }

        case BUSY:
            // recursive entry: can happen if there is a circularity involving variable and function definitions
            // Can also happen if variable evaluation is attempted in a debugger, hence the cautious message
View Full Code Here

Examples of client.net.sf.saxon.ce.tree.iter.ArrayIterator

        int[] chars = ((StringValue)item).expand();
        IntegerValue[] codes = new IntegerValue[chars.length];
        for (int i=0; i<chars.length; i++) {
            codes[i] = new IntegerValue(chars[i]);
        }
        return new ArrayIterator(codes);
    }
View Full Code Here

Examples of com.cognifide.sling.query.iterator.ArrayIterator

  @Override
  public Iterator<Resource> apply(Resource resource) {
    Resource current = resource;
    while (current != null) {
      Iterator<Resource> iterator = new ArrayIterator(current);
      iterator = selector.apply(iterator);
      if (iterator.hasNext()) {
        return iterator;
      }
      current = current.getParent();
    }
    return EmptyIterator.INSTANCE;
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.