Package fig.basic

Examples of fig.basic.LispTree.addChild()


    public LispTree toLispTree() {
      LispTree tree = LispTree.proto.newList();
      tree.addChild("alignment");
      tree.addChild(LispTree.proto.newList("source", ""+source));
      tree.addChild(LispTree.proto.newList("target", ""+target));
      tree.addChild(LispTree.proto.newList("alignment_score", ""+score));
      return tree;
    }

    public String toString() {
      StringBuilder sb = new StringBuilder();
View Full Code Here


    this.value = value;
  }

  public LispTree toLispTree() {
    LispTree tree = LispTree.proto.newList();
    tree.addChild("url");
    tree.addChild(value != null ? value : "");
    return tree;
  }
  public double getCompatibility(Value thatValue) {
    if (!(thatValue instanceof UriValue))
View Full Code Here

  }

  public LispTree toLispTree() {
    LispTree tree = LispTree.proto.newList();
    tree.addChild("url");
    tree.addChild(value != null ? value : "");
    return tree;
  }
  public double getCompatibility(Value thatValue) {
    if (!(thatValue instanceof UriValue))
      return 0.0;
View Full Code Here

  public ListValue(List<Value> values) { this.values = values; }

  public LispTree toLispTree() {
    LispTree tree = LispTree.proto.newList();
    tree.addChild("list");
    for (Value value : values)
      tree.addChild(value.toLispTree());
    return tree;
  }
View Full Code Here

  public LispTree toLispTree() {
    LispTree tree = LispTree.proto.newList();
    tree.addChild("list");
    for (Value value : values)
      tree.addChild(value.toLispTree());
    return tree;
  }

  // Compute F1 score between two lists (partial match).
  // this is target, that is predicted.
View Full Code Here

      return counter;
    }
    static LispTree counterToLispTree(Counter<String> counter) {
      LispTree tree = LispTree.proto.newList();
      for (String feature : counter.keySet())
        tree.addChild(LispTree.proto.newList(feature, "" + counter.getCount(feature)));
      return tree;
    }

    static Map<String,Double> featureMapFromLispTree(LispTree tree) {
      Map<String,Double> featureMap = new TreeMap<String,Double>();
View Full Code Here

    }

    static LispTree featureMapToLispTree(Map<String,Double> featureMap) {
      LispTree tree = LispTree.proto.newList();
      for (String feature : featureMap.keySet())
        tree.addChild(LispTree.proto.newList(feature, "" + featureMap.get(feature)));
      return tree;
    }


    static Set<String> setFromLispTree(LispTree tree) {
View Full Code Here

      return set;
    }
    static LispTree setToLispTree(Set<String> set) {
      LispTree tree = LispTree.proto.newList();
      for (String x : set)
        tree.addChild(x);
      return tree;
    }

    static String[] stringArrayFromLispTree(LispTree tree) {
      String[] result = new String[tree.children.size()];
View Full Code Here

      return result;
    }
    static LispTree stringArrayToLispTree(String[] array) {
      LispTree tree = LispTree.proto.newList();
      for (String x : array)
        tree.addChild(x);
      return tree;
    }

    public static LexicalEntry entryFromLispTree(LispTree tree) {
      int i = 1;
View Full Code Here

    public static LispTree entryToLispTree(LexicalEntry rawEntry) {
      LispTree result = LispTree.proto.newList();
      if (rawEntry instanceof LexicalEntry.EntityLexicalEntry) {
        LexicalEntry.EntityLexicalEntry entry = (LexicalEntry.EntityLexicalEntry) rawEntry;
        result.addChild("entity");

        result.addChild(entry.textDescription);
        result.addChild(entry.normalizedTextDesc);
        result.addChild(setToLispTree(entry.fbDescriptions));
        result.addChild(entry.formula.toString());
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.