Examples of Semantics

  • vn.SEMANTICS

  • Examples of synalp.commons.semantics.Semantics

     
      @Test
      @SuppressWarnings("javadoc")
      public void testFlatten()
      {
        Semantics sem1 = Semantics.readSemantics("foo(a|b c|d)");
        Semantics sem2 = Semantics.readSemantics("foo(a c) foo(b c) foo(a d) foo(b d)");
        assertTrue(new Semantics().join(sem1.flattenDisjunctions()).equals(sem2, new InstantiationContext()));
       
        sem1 = Semantics.readSemantics("foo(a|b c|d) bar(e f|g)");
        assertTrue(sem1.flattenDisjunctions().size() == 8);
      }
    View Full Code Here

    Examples of synalp.commons.semantics.Semantics

          public void focusGained(FocusEvent e){}

          public void focusLost(FocusEvent e)
          {
            String text = semanticsTA.getText();
            Semantics newMRS = Semantics.readSemantics(text);
            //Update main application
            GeneratorGUI.getGeneratorGUI().getGeneratorRun().setSelectedSemantics(newMRS);
          }
        });
    View Full Code Here

    Examples of synalp.commons.semantics.Semantics

        this.name = entry.getName();
        this.originalName = entry.getOriginalName();
        this.family = entry.getFamily();
        this.tree = new Tree(entry.getTree());
        this.trace = new Trace(entry.getTrace());
        this.semantics = new Semantics(entry.getSemantics());
        this.context = new InstantiationContext(entry.getContext());
        this.entryInterface = new FeatureStructure(entry.getInterface());
      }
    View Full Code Here

    Examples of synalp.commons.semantics.Semantics

       * semantics and instantiates it (resolve variables) in the entry current context.
       * @return a new Semantics
       */
      public Semantics getInstantiatedSemantics()
      {
        Semantics ret = new Semantics(semantics);
        semantics.instantiate(context);
        return ret;
      }
    View Full Code Here

    Examples of synalp.commons.semantics.Semantics

              /*
               * set instantiated semantics, if the fam sem is a pattern use this semantics
               * else use normally the semantics of the entry
               */
              Semantics lexSemantics = new Semantics(famSem.isPattern() ? famSem.getSemantics() : entry.getSemantics());
              lexSemantics.instantiate(famSem.getLemmas().get(lemma));
              lexEntry.setSemantics(lexSemantics);

              /*
               * set all equations: the family-wide equations, the equations for the particular lemma and the co-anchor equations.
               * Note that the family equations are only set for famSem that have lemmas!
    View Full Code Here

    Examples of synalp.commons.semantics.Semantics

          if (!found)
            kept.add(famSem1);
        }

        // now gathers all kept trace sem in the semantics
        Semantics semantics = new Semantics();
        for(FamilySemantics famSem : kept)
          semantics.addAll(famSem.getSemantics());

        entry.setSemantics(semantics);
      }
    View Full Code Here

    Examples of synalp.commons.semantics.Semantics

       * "idx".
       * @param entry
       */
      public static void clearSemantics(GrammarEntry entry)
      {
        entry.setSemantics(new Semantics());
        for(Node node : entry.getTree().getNodes())
        {
          node.getFsTop().removeFeature("idx");
          node.getFsBot().removeFeature("idx");
        }
    View Full Code Here

    Examples of synalp.commons.semantics.Semantics

            String errorMsg = "Error: unable to parse rewriting rule, check the existence of feature 'sem'";
            logger.error(errorMsg);
            throw new Exception(errorMsg);
          }
           
          Semantics sem = InputReader.readSemantics(semStr);
          RuleOperator operator = null;
          if (name.equals("add"))
            operator = new AddOperator(sem);
          else if (name.equals("del"))
            operator = new DelOperator(sem);
          else if (name.equals("replace-by"))
            operator = new ReplaceOperator(sem, matchRule.getMatch());
          else if (name.equals("replace"))
          {
            Semantics by = InputReader.readSemantics(attributes.getValue("by"));
            operator = new ReplaceOperator(by, sem);
          }
          operator.addConstants(newConstValues);
          matchRule.addOperator(operator);
        }
    View Full Code Here

    Examples of synalp.commons.semantics.Semantics

        {
          logger.error("Error: unable to parse matching rule, check the existence of feature 'match'");
          return null;
        }
       
        return new MatchingRule(InputReader.readSemantics(match), without==null ? new Semantics() : InputReader.readSemantics(without));
      }
    View Full Code Here

    Examples of synalp.commons.semantics.Semantics

       * @param context
       */
      public void apply(Semantics semantics, InstantiationContext context)
      {
        createConstants(semantics, context);
        Semantics newSem = new Semantics(add);
        newSem.instantiate(context);
        semantics.addAll(newSem);
      }
    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.