Examples of Noop


Examples of cc.mallet.pipe.Noop

      Alphabet fieldAlph = new Alphabet();
      Alphabet valueAlph = new Alphabet();
      File directory = new File(classDirs.value[i]);
      File[] subdirs = getSubDirs(directory);
      Alphabet clusterAlph = new Alphabet();
      InstanceList instances = new InstanceList(new Noop());
      TIntArrayList labels = new TIntArrayList();
      for (int j = 0; j < subdirs.length; j++) {
        ArrayList<File> records = new FileIterator(subdirs[j]).getFileArray();
        int label = clusterAlph.lookupIndex(subdirs[j].toString());
        for (int k = 0; k < records.size(); k++) {
View Full Code Here

Examples of cc.mallet.pipe.Noop

     @return array of {@link Segment}s ordered by non-decreasing
     confidence scores, as calculated by <code>estimateConfidenceFor</code>
   */
  public Segment[] rankSegmentsByConfidence (Instance instance, Object[] startTags,
                                             Object[] continueTags) {
    InstanceList ilist = new InstanceList (new Noop(instance.getDataAlphabet(),instance.getTargetAlphabet()));
    ilist.add (instance);
    return rankSegmentsByConfidence (ilist, startTags, continueTags);
  }
View Full Code Here

Examples of cc.mallet.pipe.Noop

  /**
     Iterates over {@link Segment}s for only one {@link Instance}.
   */
  public SegmentIterator (Transducer model, Instance instance, Object[] segmentStartTags,
                          Object[] segmentContinueTags) {
    InstanceList ilist = new InstanceList (new Noop (instance.getDataAlphabet(), instance.getTargetAlphabet()));
    ilist.add (instance);
    setSubIterator (model, ilist, segmentStartTags, segmentContinueTags);
  }
View Full Code Here

Examples of cc.mallet.pipe.Noop

     @param segmentContinueTags array of tags indicating the continuation of a segment
     @param predictions list of {@link Sequence}s that are the
     predicted output of some {@link Transducer}
   */
  public SegmentIterator (Instance instance, Object[] startTags, Object[] inTags,  Sequence prediction) {
    InstanceList ilist = new InstanceList (new Noop (instance.getDataAlphabet(), instance.getTargetAlphabet()));
    ilist.add (instance);
    ArrayList predictions = new ArrayList();
    predictions.add (prediction);
    setSubIterator (ilist, startTags, inTags, predictions);
  }
View Full Code Here

Examples of cc.mallet.pipe.Noop

        // Create a "fake" pipe with the features in the data and
        //  a trove int-int hashmap of topic counts in the target.
       
        if (parameterPipe == null) {
            parameterPipe = new Noop();

            parameterPipe.setDataAlphabet(data.get(0).instance.getTargetAlphabet());
            parameterPipe.setTargetAlphabet(topicAlphabet);
        }
View Full Code Here

Examples of cc.mallet.pipe.Noop

  public void testParenGroupIterator ()
  {
    String input = "(a (b c) ((d))  ) f\n\n (3\n 4) (  6) ";
    Reader reader = new StringReader (input);
    ParenGroupIterator it = new ParenGroupIterator (reader);
    Pipe pipe = new Noop();
    pipe.setTargetProcessing (false);

    InstanceList lst = new InstanceList (pipe);
    lst.addThruPipe (it);

    assertEquals (3, lst.size());
View Full Code Here

Examples of com.blitline.image.functions.NoOp

  public static Modulate modulate() {
    return new Modulate();
  }

  public static NoOp noOp() {
    return new NoOp();
  }
View Full Code Here

Examples of com.google.caja.parser.js.Noop

    assertTrue(n.children().get(0).isImmutable());
    assertTrue(n.children().get(0).children().get(0).isImmutable());
    assertTrue(n.children().get(1).isImmutable());
    assertTrue(n.children().get(1).children().get(0).isImmutable());
    try {
      n.appendChild(new Noop(FilePosition.UNKNOWN));
      fail();
    } catch (UnsupportedOperationException e) { /* OK */ }
    try {
      n.setComments(Arrays.asList(
          Token.instance("test", JsTokenType.COMMENT, FilePosition.UNKNOWN)));
View Full Code Here

Examples of com.google.caja.parser.js.Noop

      if (nEmitted < n) {
        newChildren.addAll(children.subList(nEmitted, n));
      }
      if (newChildren.size() < 2) {
        out.node = newChildren.isEmpty()
            ? new Noop(UNK) : (Statement) newChildren.get(0);
        out.digest = optNodeDigest(out.node);
      } else {
        out.node = new Conditional(UNK, null, newChildren);
        out.digest = sb != null ? sb.toString() : null;
      }
View Full Code Here

Examples of com.google.caja.parser.js.Noop

          flattened == null ? Lists.newArrayList(children) : flattened);
      List<Statement> newChildren = joined != null ? joined : flattened;
      if (newChildren != null) { nChildren = newChildren.size(); }
      if (!needsBlock) {
        switch (nChildren) {
          case 0: return new Noop(n.getFilePosition());
          case 1: return (newChildren == null ? children : newChildren).get(0);
        }
      }
      return newChildren != null
          ? new Block(n.getFilePosition(), newChildren) : n;
    } else if (n instanceof SwitchStmt) {
      return optimizeSwitch((SwitchStmt) n);
    } else if (n instanceof ReturnStmt) {
      ReturnStmt rs = (ReturnStmt) n;
      Expression returnValue = rs.getReturnValue();
      Expression optReturnValue = returnValue != null
          ? (Expression) optimize(returnValue, false)
          : null;
      if (optReturnValue != null && returnValue != null  // 2nd implied by 1st
          && "undefined".equals(returnValue.typeOf())
          && optReturnValue.simplifyForSideEffect() == null) {
        return new ReturnStmt(rs.getFilePosition(), null);
      } else if (optReturnValue != returnValue) {
        return new ReturnStmt(rs.getFilePosition(), optReturnValue);
      }
      return rs;
    } else {
      List<? extends ParseTreeNode> children = n.children();
      int nChildren = children.size();
      List<ParseTreeNode> newChildren = null;
      boolean childNeedsBlock = (
          n instanceof FunctionConstructor || n instanceof TryStmt
          || n instanceof CatchStmt || n instanceof FinallyStmt
          || n instanceof SwitchCase);
      for (int i = 0; i < nChildren; ++i) {
        ParseTreeNode child = children.get(i);
        ParseTreeNode newChild = optimize(child, childNeedsBlock);
        if (child != newChild) {
          if (newChildren == null) {
            newChildren = Lists.newArrayListWithCapacity(nChildren);
          }
          newChildren.addAll(children.subList(newChildren.size(), i));
          newChildren.add(newChild);
        }
      }
      if (newChildren != null) {
        newChildren.addAll(children.subList(newChildren.size(), nChildren));
      }
      List<? extends ParseTreeNode> outChildren = newChildren == null
          ? children : newChildren;
      if (n instanceof ExpressionStmt) {
        Expression e = (Expression) outChildren.get(0);
        Expression simple = e.simplifyForSideEffect();
        if (simple == null) { return new Noop(n.getFilePosition()); }
        if (simple != e) {
          newChildren = Collections.<ParseTreeNode>singletonList(simple);
        }
      } else if (n instanceof Conditional) {
        List<ParseTreeNode> condParts = newChildren != null
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.