Package synalp.commons.input

Examples of synalp.commons.input.Lemma


    this.noAdjunction = node.isNoAdjunction();
    this.phonE = node.isPhonE();
    this.fsTop = new FeatureStructure(node.getFsTop());
    this.fsBot = new FeatureStructure(node.getFsBot());
    if (node.getAnchorLemma() != null)
      this.anchor = new Lemma(node.getAnchorLemma());
    for(Node child : node.getChildren())
      children.add(new Node(child, this));
  }
View Full Code Here


    node.setNoAdjunction(true);

    // the anchor lemma of the parent is the category of the child node, we take here the first value of the category if it exists
    if (node.getCategory() != null && !node.getCategory().getValues().isEmpty())
    {
      node.setAnchorLemma(new Lemma(node.getCategory().getFirstValue()), true);
      node.getFsTop().addConstantFeature("lemma", node.getCategory());
      node.getFsBot().addConstantFeature("lemma", node.getCategory());
    }

    if (node.getParent() != null)
View Full Code Here

    parent.setFsTop(newTop);

    // the anchor lemma of the parent is the category of the child node, we take here the first value of the category if it exists
    if (node.getCategory() != null && !node.getCategory().getValues().isEmpty())
    {
      parent.setAnchorLemma(new Lemma(node.getCategory().getFirstValue()), true);
      parent.getFsTop().addConstantFeature("lemma", node.getCategory());
      parent.getFsBot().addConstantFeature("lemma", node.getCategory());
    }

    parent.removeChild(node);
View Full Code Here

      if (feat.getName().equals("lemma"))
      {
        if (node.getType() != NodeType.COANCHOR && node.getType() != NodeType.ANCHOR)
          node.setType(NodeType.COANCHOR);
        node.setAnchorLemma(new Lemma(feat.getValue().toString()));
      }
    }
  }
View Full Code Here

  public void lemmatizeLeaves()
  {
    for(Node node : getYield())
      if (node.getAnchorLemma() == null)
      {
        Lemma anchor = new Lemma(node.getCategory().getFirstValue());
        FeatureStructure fs = new FeatureStructure();
        anchor.setFs(fs);
        anchor.setCategory(node.getCategory());
        node.setAnchorLemma(anchor);
      }
  }
View Full Code Here

    if (name == null)
    {
      if (!GeneratorOption.ALLOW_EMPTY_LEMMAS)
        throw new SAXException("Error: a lemma is missing a 'name' attribute, family '" + attributes.getValue("family") + "'");
    }
    else ret.setLemma(new Lemma(name));
    String family = attributes.getValue("family");
    if (family == null)
      throw new SAXException("Error: lemma '" + name + "' is missing a 'family' attribute");

    if (family.indexOf(',') != -1)
View Full Code Here

   * @return a SyntacticLexiconEntry
   */
  public SyntacticLexiconEntry convertEntry(Macros macros)
  {
    SyntacticLexiconEntry ret = new SyntacticLexiconEntry();
    ret.setLemma(new Lemma(name));
    ret.setFamilies(family);
    try
    {
      ret.setEquations(equations.aggregate());
    }
View Full Code Here

  {
    Feature lemmaFeat = fs.getFeature("lemma");
    if (lemmaFeat != null)
    {
      FeatureValue val = context.getValue(lemmaFeat.getValue());
      node.setAnchorLemma(new Lemma(val.toString()));
    }
  }
View Full Code Here

  {
    Feature lemmaFeat = fs.getFeature("lemma");
    if (lemmaFeat != null)
    {
      FeatureValue val = context.getValue(lemmaFeat.getValue());
      node.setAnchorLemma(new Lemma(val.toString()));
    }
  }
View Full Code Here

    if (!coanchors.isEmpty())
    {
      List<Node> coanchorNodes = entry.getTree().getNodesByType(NodeType.COANCHOR);
      for(int i = 0; i < coanchors.size(); i++)
      {
        Lemma coanchor = coanchors.get(i);
        Node coanchorNode = coanchorNodes.get(i);
        FeatureStructure fs = new FeatureStructure().addConstantFeature("lemma", coanchor.getValue());
        lexEntry.getEquations().add(new Equation(coanchorNode.getId(), FeatureStructureType.TOP, fs, true));
      }
    }
  }
View Full Code Here

TOP

Related Classes of synalp.commons.input.Lemma

Copyright © 2018 www.massapicom. 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.