Package fig.basic

Examples of fig.basic.LispTree


    this.func = func;
    this.args = args;
  }

  public LispTree toLispTree() {
    LispTree tree = LispTree.proto.newList();
    tree.addChild("call");
    tree.addChild(func.toLispTree());
    for (Formula arg : args)
      tree.addChild(arg.toLispTree());
    return tree;
  }
View Full Code Here


    newFv.add(featureVector);
    return new FeatureSimilarity(newFv, source, target, score);
  }

  public LispTree toLispTree() {
    LispTree tree = LispTree.proto.newList();
    tree.addChild("similarity");
    tree.addChild(LispTree.proto.newList("source", source));
    tree.addChild(LispTree.proto.newList("target", target));
    tree.addChild(LispTree.proto.newList("sim_score", ""+score));
    return tree;
  }
View Full Code Here

    this.var = var;
    this.body = body;
  }

  public LispTree toLispTree() {
    LispTree tree = LispTree.proto.newList();
    tree.addChild("mark");
    tree.addChild(var);
    tree.addChild(body.toLispTree());
    return tree;
  }
View Full Code Here

  public ErrorValue(LispTree tree) { this.type = tree.child(1).value; }
  public ErrorValue(String type) { this.type = type; }

  public LispTree toLispTree() {
    LispTree tree = LispTree.proto.newList();
    tree.addChild("error");
    tree.addChild(type != null ? type : "");
    return tree;
  }
View Full Code Here

    this.month = Integer.valueOf(tree.child(2).value);
    this.day = Integer.valueOf(tree.child(3).value);
  }

  public LispTree toLispTree() {
    LispTree tree = LispTree.proto.newList();
    tree.addChild("date");
    tree.addChild(String.valueOf(year));
    tree.addChild(String.valueOf(month));
    tree.addChild(String.valueOf(day));
    return tree;
  }
View Full Code Here

  public static final Map<String,Counter<String>> verbSemclassMap = VerbSemClassExtractor.getWordToWordCounterMap();

  public DeletionRule(String expression) {
    super(expression);
    LispTree tree = LispTree.proto.parseFromString(expression);
    LispTree rhsTree = tree.child(2);
    if(rhsTree.children.size()!=3)
      throw new RuntimeException("In a deletion rules there must be exactly three items on the rhs");
  }
View Full Code Here

class SubstitutionRule extends SyntacticRule {

  public SubstitutionRule(String expression) {
    super(expression);
    LispTree tree = LispTree.proto.parseFromString(expression);
    LispTree rhsTree = tree.child(2);
    if(rhsTree.children.size()!=3)
      throw new RuntimeException("In a substitution rules there must be exactly three items on the rhs");
  }
View Full Code Here

    public String toString() {
      return toLispTree().toString();
    }
    public LispTree toLispTree() {
      LispTree tree = LispTree.proto.newList();
      tree.addChild("wordinfo");
      tree.addChild(token);
      tree.addChild(lemma);
      tree.addChild(pos);
      tree.addChild(nerTag);
      return tree;
    }
View Full Code Here

class MoveRule extends SyntacticRule {

  public MoveRule(String expression) {
    super(expression);
    LispTree tree = LispTree.proto.parseFromString(expression);
    LispTree rhsTree = tree.child(2);
    if(rhsTree.children.size()!=3)
      throw new RuntimeException("In a substitution rules there must be exactly three items on the rhs");
  }
View Full Code Here

 
  PhraseTable phraseTable;

  public PhraseTableRule(String expression) {
    super(expression);
    LispTree tree = LispTree.proto.parseFromString(expression);
    LispTree rhsTree = tree.child(2);
    if(rhsTree.children.size()!=3)
      throw new RuntimeException("In a phrasetable rule there must be exactly three items on the rhs");
   
    if(phraseTable==null)
      phraseTable = PhraseTable.getSingleton();
View Full Code Here

TOP

Related Classes of fig.basic.LispTree

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.