Examples of Justification


Examples of com.slytechs.utils.format.Formattable.Justification

    b.setLength(0);
  }
 
  private void sendToOutput(Appendable out) throws IOException {
    int jw = getWidth() - b.length();
    Justification j = justification;
   
//    if (jw < 0) {
//      j = Justification.None;
//    }
   
View Full Code Here

Examples of it.stefanobertini.zebra.cpcl.labelmode.Justification

public class JustificationTest {

    @Test
    public void testLeft() {
  Justification command = new Justification(JustificationType.left);

  CommandOutputBuilder output = new CommandOutputBuilder();
  output.printLn("LEFT");

  assertCommand(output, command);
View Full Code Here

Examples of it.stefanobertini.zebra.cpcl.labelmode.Justification

  assertCommand(output, command);
    }

    @Test
    public void testCenter() {
  Justification command = new Justification(JustificationType.center);

  CommandOutputBuilder output = new CommandOutputBuilder();
  output.printLn("CENTER");

  assertCommand(output, command);
View Full Code Here

Examples of it.stefanobertini.zebra.cpcl.labelmode.Justification

  assertCommand(output, command);
    }

    @Test
    public void testRight() {
  Justification command = new Justification(JustificationType.right);

  CommandOutputBuilder output = new CommandOutputBuilder();
  output.printLn("RIGHT");

  assertCommand(output, command);
View Full Code Here

Examples of it.stefanobertini.zebra.cpcl.linemode.Justification

public class JustificationTest {

    @Test
    public void testLeft() {
  Justification command = new Justification(JustificationType.left);

  CommandOutputBuilder output = new CommandOutputBuilder();
  output.printLn("! U1 LEFT");

  assertCommand(output, command);
View Full Code Here

Examples of it.stefanobertini.zebra.cpcl.linemode.Justification

  assertCommand(output, command);
    }

    @Test
    public void testCenter() {
  Justification command = new Justification(JustificationType.center);

  CommandOutputBuilder output = new CommandOutputBuilder();
  output.printLn("! U1 CENTER");

  assertCommand(output, command);
View Full Code Here

Examples of it.stefanobertini.zebra.cpcl.linemode.Justification

  assertCommand(output, command);
    }

    @Test
    public void testRight() {
  Justification command = new Justification(JustificationType.right);

  CommandOutputBuilder output = new CommandOutputBuilder();
  output.printLn("! U1 RIGHT");

  assertCommand(output, command);
View Full Code Here

Examples of org.apache.marmotta.kiwi.reasoner.model.program.Justification

        result.append("{\n ");

        result.append("\"triple\": " + formatJSON(triple) + ",\n");
        result.append("\"justifications\": [\n");
        for(Iterator<Justification> justs = justifications.iterator(); justs.hasNext(); ) {
            Justification justification = justs.next();
            result.append("  {\n");
            result.append("    \"triples\": [\n");
            for(Iterator<KiWiTriple> it = justification.getSupportingTriples().iterator(); it.hasNext(); ) {
                KiWiTriple t = it.next();
                result.append("      " + formatJSON(t));
                if(it.hasNext()) {
                    result.append(",\n");
                } else {
                    result.append("\n");
                }
            }
            result.append("    ],");
            result.append("    \"rules\": [\n");
            for(Iterator<Rule> it = justification.getSupportingRules().iterator(); it.hasNext(); ) {
                Rule r = it.next();
                result.append("      \""+r.toString().replace("\"","'")+"\"");
                if(it.hasNext()) {
                    result.append(",\n");
                } else {
View Full Code Here

Examples of org.apache.marmotta.kiwi.reasoner.model.program.Justification

            KiWiTriple triple = (KiWiTriple)inferred.get(0);
            List<Justification> justifications = Iterations.asList(rcon.listJustificationsForTriple(triple));
            Assert.assertEquals("number of justifications for triple differs from expected result",1,justifications.size());

            Justification j = justifications.get(0);
            Assert.assertEquals("number of supporting triples differs from expected result",1,j.getSupportingTriples().size());
            Assert.assertEquals("number of supporting rules differs from expected result",1,j.getSupportingRules().size());

            Assert.assertThat("supporting triple does not match expectation", j.getSupportingTriples(), hasItem((KiWiTriple)statements.get(0)));

            con.commit();


            // now remove again the base triple and inform the reasoner about it, as a consequence, the inferred
View Full Code Here

Examples of org.apache.marmotta.kiwi.reasoner.model.program.Justification

            KiWiTriple triple = (KiWiTriple)inferred.get(0);
            List<Justification> justifications = Iterations.asList(rcon.listJustificationsForTriple(triple));
            Assert.assertEquals("number of justifications for triple differs from expected result",1,justifications.size());

            Justification j = justifications.get(0);
            Assert.assertEquals("number of supporting triples differs from expected result",2,j.getSupportingTriples().size());
            Assert.assertEquals("number of supporting rules differs from expected result",1,j.getSupportingRules().size());

            Assert.assertThat("supporting triple does not match expectation", j.getSupportingTriples(), hasItem((KiWiTriple)statements.get(0)));
            Assert.assertThat("supporting triple does not match expectation", j.getSupportingTriples(), hasItem((KiWiTriple)statements.get(1)));

            con.commit();


            // add another triple and check if the incremental reasoning works
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.