/** * Make a TreeFactory that produces LabeledScoredTree trees. * The labels are of class <code>CoreLabel</code>. */ public LabeledScoredTreeFactory() { this(CoreLabel.factory()); }
/** * {@inheritDoc} */ @Override public LabelFactory labelFactory() { return CoreLabel.factory(); }
/** * Make a {@code TreeFactory} that produces * {@code TreeGraphNode}s. The labels are of class * {@code CoreLabel}. */ public TreeGraphNodeFactory() { this(CoreLabel.factory()); }
public LabeledScoredTreeReaderFactory(TreeNormalizer tm) { lf = CoreLabel.factory(); this.tm = tm; }
public Debinarizer(boolean forceCNF) { this(forceCNF, CoreLabel.factory()); }
/** * Create a new TreeReaderFactory with CoreLabel labels. */ public LabeledScoredTreeReaderFactory() { lf = CoreLabel.factory(); tm = new BobChrisTreeNormalizer(); }
return (E) new PennTreeReader(new StringReader(value), new LabeledScoredTreeFactory(CoreLabel.factory())).readTree(); } catch (IOException e) { throw new RuntimeException(e);
/** * Copies the Auxiliary tree. Also, puts the new names->nodes map in the TsurgeonMatcher that called copy. * <br> * The trees and labels to use when making the copy are specified * with treeFactory and labelFactory. This lets the tsurgeon script * produce trees which are of the same type as the input trees. * Each of the tsurgeon relations which copies a tree should include * pass in the correct factories. */ public AuxiliaryTree copy(TsurgeonMatcher matcher, TreeFactory treeFactory, LabelFactory labelFactory) { if (labelFactory == null) { labelFactory = CoreLabel.factory(); } Map<String,Tree> newNamesToNodes = Generics.newHashMap(); Pair<Tree,Tree> result = copyHelper(tree, newNamesToNodes, treeFactory, labelFactory); //if(! result.first().dominates(result.second())) //log.info("Error -- aux tree copy doesn't dominate foot copy."); matcher.newNodeNames.putAll(newNamesToNodes); return new AuxiliaryTree(result.first(), result.second(), newNamesToNodes, originalTreeString); }
/** * Return a {@code TreeFactory} that produces trees of the * same type as the current {@code Tree}. That is, this * implementation, will produce trees of type * {@code LabeledScoredTree(Node|Leaf)}. * The {@code Label} of {@code this} * is examined, and providing it is not {@code null}, a * {@code LabelFactory} which will produce that kind of * {@code Label} is supplied to the {@code TreeFactory}. * If the {@code Label} is {@code null}, a * {@code StringLabelFactory} will be used. * The factories returned on different calls a different: a new one is * allocated each time. * * @return a factory to produce labeled, scored trees */ @Override public TreeFactory treeFactory() { LabelFactory lf = (label() == null) ? CoreLabel.factory() : label().labelFactory(); return new LabeledScoredTreeFactory(lf); }
/** * Returns a {@code TreeFactory} that produces * {@code TreeGraphNode}s. The {@code Label} of * {@code this} is examined, and providing it is not * {@code null}, a {@code LabelFactory} which will * produce that kind of {@code Label} is supplied to the * {@code TreeFactory}. If the {@code Label} is * {@code null}, a * {@code CoreLabel.factory()} will be used. The factories * returned on different calls are different: a new one is * allocated each time. * * @return a factory to produce treegraphs */ @Override public TreeFactory treeFactory() { LabelFactory lf; if (label() != null) { lf = label().labelFactory(); } else { lf = CoreLabel.factory(); } return new TreeGraphNodeFactory(lf); }
Tree tree = new PennTreeReader(new StringReader(line), new LabeledScoredTreeFactory(CoreLabel.factory())).readTree(); sentence.set(TreeCoreAnnotations.TreeAnnotation.class, tree);
/** * {@inheritDoc} */ @Override public LabelFactory labelFactory() { return CoreLabel.factory(); }
/** * {@inheritDoc} */ @Override public LabelFactory labelFactory() { return CoreLabel.factory(); }
/** * Make a {@code TreeFactory} that produces * {@code TreeGraphNode}s. The labels are of class * {@code CoreLabel}. */ public TreeGraphNodeFactory() { this(CoreLabel.factory()); }
/** * Make a TreeFactory that produces LabeledScoredTree trees. * The labels are of class <code>CoreLabel</code>. */ public LabeledScoredTreeFactory() { this(CoreLabel.factory()); }
/** * Make a {@code TreeFactory} that produces * {@code TreeGraphNode}s. The labels are of class * {@code CoreLabel}. */ public TreeGraphNodeFactory() { this(CoreLabel.factory()); }
/** * Make a TreeFactory that produces LabeledScoredTree trees. * The labels are of class <code>CoreLabel</code>. */ public LabeledScoredTreeFactory() { this(CoreLabel.factory()); }
/** * Create a new TreeReaderFactory with CategoryWordTag labels. */ public LabeledScoredTreeReaderFactory() { lf = CoreLabel.factory(); tm = new BobChrisTreeNormalizer(); }
/** * Create a new TreeReaderFactory with CategoryWordTag labels. */ public LabeledScoredTreeReaderFactory() { lf = CoreLabel.factory(); tm = new BobChrisTreeNormalizer(); }