Examples of arity()


Examples of joshua.corpus.MatchedHierarchicalPhrases.arity()

    MatchedHierarchicalPhrases matches =
      suffixArray.createHierarchicalPhrases(pattern, minNonterminalSpan, maxPhraseSpan);
   
    Assert.assertNotNull(matches);
    Assert.assertEquals(matches.getPattern(), pattern);
    Assert.assertEquals(matches.arity(), 0);
    Assert.assertEquals(matches.size(), 1);
  }
 
  @Test(dependsOnMethods={"findTriviallyHieroPhrase"})
  public void findHieroPhrase() {
View Full Code Here

Examples of joshua.corpus.suffix_array.HierarchicalPhrases.arity()

    int[]       sentenceNumbers = {0};
   
    HierarchicalPhrases phrases =
      new HierarchicalPhrases(pattern, terminalSequenceStartIndices, sentenceNumbers);
   
    int arity = phrases.arity();
    int n = phrases.getNumberOfTerminalSequences();
   
    Assert.assertEquals(arity, 0);
    Assert.assertEquals(n, 1);
   
View Full Code Here

Examples of joshua.corpus.suffix_array.Pattern.arity()

    for (int i=0; i<extendedWords.length; i++) {
      Assert.assertEquals(extendedPattern.getWordIDs()[i], extendedWords[i]);
    }
   
    Assert.assertEquals(extendedPattern.getVocab(), vocab);
    Assert.assertEquals(extendedPattern.arity(), 2);
     
  }
 
  @Test(dependsOnMethods = {"basicPattern"})
  public void copiedPattern() {
View Full Code Here

Examples of kodkod.ast.Expression.arity()

                for(int j=s2.arity(); j>1; j--) s=s.product(Expression.UNIV);
                return s.intersection(s2);
            case RANGE:
                s=cset(a);
                s2=cset(b);
                for(int j=s.arity(); j>1; j--) s2=Expression.UNIV.product(s2);
                return s.intersection(s2);
        }
        throw new ErrorFatal(x.pos, "Unsupported operator ("+x.op+") encountered during ExprBinary.accept()");
    }
View Full Code Here

Examples of kodkod.ast.Relation.arity()

         
          if (!rparts.representatives.contains(sym.min())) continue// r does not range over sym
         
          BooleanMatrix m = interpreter.interpret(r);
          for(IndexedEntry<BooleanValue> entry : m) {
            int permIndex = permutation(r.arity(), entry.index(), prevIndex, curIndex);
            BooleanValue permValue = m.get(permIndex);
            if (permIndex==entry.index() || atSameIndex(original, permValue, permuted, entry.value()))
              continue;
           
            original.add(entry.value());
View Full Code Here

Examples of kodkod.instance.Tuple.arity()

                ts.add(xx);
                continue;
             }
             if (x instanceof Tuple) { // This means it's a Tuple
                Tuple xx=(Tuple)x;
                if (ts==null) ts=fac.noneOf(xx.arity());
                ts.add(xx);
                continue;
             }
             if (x instanceof String) { // The empty string means the sig name follows here
                i++;
View Full Code Here

Examples of kodkod.instance.TupleSet.arity()

              PrimSig sub = (PrimSig)b1;
              Field f1 = s.getFields().get(0), f2 = s.getFields().get(1);
              if (sub.isEnum==null || !list.args.get(0).isSame(sub) || !list.args.get(1).isSame(s.join(f1)) || !list.args.get(2).isSame(s.join(f2))) break;
              // Now, we've confirmed it is a total ordering on an enum. Let's pre-bind the relations
              TupleSet me = sol.query(true, sol.a2k(s), false), firstTS = factory.noneOf(2), lastTS = null, nextTS = factory.noneOf(3);
              if (me.size()!=1 || me.arity()!=1) break;
              int n = sub.children().size();
              for(PrimSig c: sub.children()) {
                 TupleSet TS = sol.query(true, sol.a2k(c), false);
                 if (TS.size()!=1 || TS.arity()!=1) { firstTS=factory.noneOf(2); nextTS=factory.noneOf(3); break; }
                 if (lastTS==null) { firstTS=me.product(TS); lastTS=TS; continue; }
View Full Code Here

Examples of net.fortytwo.ripple.model.StackMapping.arity()

                    Closure c = new Closure(right.getFirst().getMapping(), first);
                    right = right.getRest();
                    left = left.getRest().push(new Operator(c));
                }
            } else {
                if (0 == f.arity()) {
                    Collector<RippleList> results = new Collector<RippleList>();
                    // Note: synchronous evaluation is required
                    // Note: stack context is trivial
                    f.apply(left.getRest(), results, mc);
                    for (RippleList s : results) {
View Full Code Here

Examples of org.apache.pig.data.ExampleTuple.arity()

            if (outputConstraint.arity() != schema.numFields()) throw new RuntimeException("Internal error: incorrect number of fields in constraint tuple.");
           
            Tuple inputT = new Tuple(outputConstraint.arity());
            ExampleTuple inputTuple = new ExampleTuple();
            inputTuple.copyFrom(inputT);
            for (int i = 0; i < inputTuple.arity(); i++) {
                Datum d = outputConstraint.getField(i);
                if (d == null) d = exampleTuple.getField(i);
                inputTuple.setField(i, d);
            }
            if(inputTuple.equals(exampleTuple)) {
View Full Code Here

Examples of org.apache.pig.data.Tuple.arity()

        // (while synthesizing individual fields, try to match fields that exist in the real data)
        for (Iterator<Tuple> it = outputConstraints.iterator(); it.hasNext(); ) {
            Tuple outputConstraint = it.next();
           
            // sanity check:
            if (outputConstraint.arity() != schema.numFields()) throw new RuntimeException("Internal error: incorrect number of fields in constraint tuple.");
           
            Tuple inputT = new Tuple(outputConstraint.arity());
            ExampleTuple inputTuple = new ExampleTuple();
            inputTuple.copyFrom(inputT);
            for (int i = 0; i < inputTuple.arity(); i++) {
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.