Examples of Lemma


Examples of synalp.commons.input.Lemma

    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

Examples of synalp.commons.input.Lemma

      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

Examples of synalp.commons.input.Lemma

  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

Examples of synalp.commons.input.Lemma

    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

Examples of synalp.commons.input.Lemma

   * @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

Examples of synalp.commons.input.Lemma

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

Examples of synalp.commons.input.Lemma

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

Examples of synalp.commons.input.Lemma

    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

Examples of synalp.commons.input.Lemma

      String value = attributes.getValue("value");
      if (value == null)
        logger.error("Error: unable to find lemma value attribute for family semantics " + curFamilySemantics);
      else
      {
        curLemma = new Lemma(value.trim());
        curContext = new InstantiationContext();

        Equations equations = new Equations();
        String eq = attributes.getValue("eq");
        if (eq != null)
View Full Code Here

Examples of synalp.commons.input.Lemma

   */
  private static Lemma[] createLemmas(String[] lemmas)
  {
    Lemma[] ret = new Lemma[lemmas.length];
    for(int i = 0; i < lemmas.length; i++)
      ret[i] = new Lemma(lemmas[i]);
    return ret;
  }
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.