if (tree.child(0).value.equals("entity")) {
String textDescription = tree.child(i++).value;
String normalizedTextDesc = tree.child(i++).value;
Set<String> fbDescriptions = setFromLispTree(tree.child(i++));
Formula formula = Formula.fromString(tree.child(i++).value);
EntrySource source = EntrySource.parseSourceDesc(tree.child(i++).value);
double popularity = Double.parseDouble(tree.child(i++).value);
double distance = Double.parseDouble(tree.child(i++).value);
Set<String> types = setFromLispTree(tree.child(i++));
Counter<String> tokenEditDistanceFeatures = counterFromLispTree(tree.child(i++));
return new LexicalEntry.EntityLexicalEntry(
textDescription, normalizedTextDesc, fbDescriptions, formula,
source, popularity, distance, types, tokenEditDistanceFeatures);
} else if (tree.child(0).value.equals("unary")) {
String textDescription = tree.child(i++).value;
String normalizedTextDesc = tree.child(i++).value;
Set<String> fbDescriptions = setFromLispTree(tree.child(i++));
Formula formula = Formula.fromString(tree.child(i++).value);
EntrySource source = EntrySource.parseSourceDesc(tree.child(i++).value);
double popularity = Double.parseDouble(tree.child(i++).value);
Double.parseDouble(tree.child(i++).value);
Map<String,Double> alignmentScores = featureMapFromLispTree(tree.child(i++));
Set<String> types = setFromLispTree(tree.child(i++));
return new LexicalEntry.UnaryLexicalEntry(
textDescription, normalizedTextDesc, fbDescriptions, formula, source,
popularity, alignmentScores, types);
} else if (tree.child(0).value.equals("binary")) {
String textDescription = tree.child(i++).value;
String normalizedTextDesc = tree.child(i++).value;
Set<String> fbDescriptions = setFromLispTree(tree.child(i++));
Formula formula = Formula.fromString(tree.child(i++).value);
EntrySource source = EntrySource.parseSourceDesc(tree.child(i++).value);
double popularity = Double.parseDouble(tree.child(i++).value);
Double.parseDouble(tree.child(i++).value); //this is computed in the constructor so need not save it
String expectedType1 = tree.child(i++).value;
String expectedType2 = tree.child(i++).value;