/** * Construct a new {@code CollocationFinder} over the {@code Tree} t. * The default {@link HeadFinder} is a {@link CollinsHeadFinder}. * @param t parse tree * @param w wordnet connection */ public CollocationFinder(Tree t, WordNetConnection w) { this(t, w, new CollinsHeadFinder()); }
/** * This method just tests the functionality of the included transformers. */ public static void main(String[] args) { //TreeFactory tf = new LabeledScoredTreeFactory(); Tree stringyTree = null; try { stringyTree = (new PennTreeReader(new StringReader("(S (VP (VBZ Try) (NP (DT this))) (. .))"), new LabeledScoredTreeFactory(new StringLabelFactory()))).readTree(); } catch (IOException e) { // do nothing } System.out.println(stringyTree); Function<Tree, Tree> a = getLabeledTreeToCategoryWordTagTreeFunction(); Tree adaptyTree = a.apply(stringyTree); System.out.println(adaptyTree); adaptyTree.percolateHeads(new CollinsHeadFinder()); System.out.println(adaptyTree); Function<Tree, Tree> b = getLabeledTreeToStringLabeledTreeFunction(); Tree stringLabelTree = b.apply(adaptyTree); System.out.println(stringLabelTree); }
return new ChineseSemanticHeadFinder(); } else if(headfinderName.equalsIgnoreCase("CollinsHeadFinder")) { return new CollinsHeadFinder(); } else if(headfinderName.equalsIgnoreCase("DybroFrenchHeadFinder")) { return new DybroFrenchHeadFinder();
/** * Go through trees and determine their heads and print them. * Just for debuggin'. <br> * Usage: <code> * java edu.stanford.nlp.trees.CollinsHeadFinder treebankFilePath * </code> * * @param args The treebankFilePath */ public static void main(String[] args) { Treebank treebank = new DiskTreebank(); CategoryWordTag.suppressTerminalDetails = true; treebank.loadPath(args[0]); final HeadFinder chf = new CollinsHeadFinder(); treebank.apply(pt -> { pt.percolateHeads(chf); pt.pennPrint(); System.out.println(); }); }
HeadFinder hf = new CollinsHeadFinder(); if(headFinderClassName != null) { Class[] hfArgClasses = new Class[headFinderArgs.length];
/** * Construct a new {@code CollocationFinder} over the {@code Tree} t. * The default {@link HeadFinder} is a {@link CollinsHeadFinder}. * @param t parse tree * @param w wordnet connection */ public CollocationFinder(Tree t, WordNetConnection w) { this(t, w, new CollinsHeadFinder()); }
/** * Construct a new {@code CollocationFinder} over the {@code Tree} t. * The default {@link HeadFinder} is a {@link CollinsHeadFinder}. * @param t parse tree * @param w wordnet connection */ public CollocationFinder(Tree t, WordNetConnection w) { this(t, w, new CollinsHeadFinder()); }
/** * Construct a new {@code CollocationFinder} over the {@code Tree} t. * The default {@link HeadFinder} is a {@link CollinsHeadFinder}. * @param t parse tree * @param w wordnet connection */ public CollocationFinder(Tree t, WordNetConnection w) { this(t, w, new CollinsHeadFinder()); }
/** * Construct a new {@code CollocationFinder} over the {@code Tree} t. * The default {@link HeadFinder} is a {@link CollinsHeadFinder}. * @param t parse tree * @param w wordnet connection */ public CollocationFinder(Tree t, WordNetConnection w) { this(t, w, new CollinsHeadFinder()); }
/** * This method just tests the functionality of the included transformers. */ public static void main(String[] args) { //TreeFactory tf = new LabeledScoredTreeFactory(); Tree stringyTree = null; try { stringyTree = (new PennTreeReader(new StringReader("(S (VP (VBZ Try) (NP (DT this))) (. .))"), new LabeledScoredTreeFactory(new StringLabelFactory()))).readTree(); } catch (IOException e) { // do nothing } System.out.println(stringyTree); Function<Tree, Tree> a = getLabeledTreeToCategoryWordTagTreeFunction(); Tree adaptyTree = a.apply(stringyTree); System.out.println(adaptyTree); adaptyTree.percolateHeads(new CollinsHeadFinder()); System.out.println(adaptyTree); Function<Tree, Tree> b = getLabeledTreeToStringLabeledTreeFunction(); Tree stringLabelTree = b.apply(adaptyTree); System.out.println(stringLabelTree); }
/** * This method just tests the functionality of the included transformers. */ public static void main(String[] args) { //TreeFactory tf = new LabeledScoredTreeFactory(); Tree stringyTree = null; try { stringyTree = (new PennTreeReader(new StringReader("(S (VP (VBZ Try) (NP (DT this))) (. .))"), new LabeledScoredTreeFactory(new StringLabelFactory()))).readTree(); } catch (IOException e) { // do nothing } System.out.println(stringyTree); Function<Tree, Tree> a = getLabeledTreeToCategoryWordTagTreeFunction(); Tree adaptyTree = a.apply(stringyTree); System.out.println(adaptyTree); adaptyTree.percolateHeads(new CollinsHeadFinder()); System.out.println(adaptyTree); Function<Tree, Tree> b = getLabeledTreeToStringLabeledTreeFunction(); Tree stringLabelTree = b.apply(adaptyTree); System.out.println(stringLabelTree); }
/** * Go through trees and determine their heads and print them. * Just for debuggin'. <br> * Usage: <code> * java edu.stanford.nlp.trees.CollinsHeadFinder treebankFilePath * </code> * * @param args The treebankFilePath */ public static void main(String[] args) { Treebank treebank = new DiskTreebank(); CategoryWordTag.suppressTerminalDetails = true; treebank.loadPath(args[0]); final HeadFinder chf = new CollinsHeadFinder(); treebank.apply(new TreeVisitor() { @Override public void visitTree(Tree pt) { pt.percolateHeads(chf); pt.pennPrint(); System.out.println(); } }); }
return new ChineseSemanticHeadFinder(); } else if(headfinderName.equalsIgnoreCase("CollinsHeadFinder")) { return new CollinsHeadFinder(); } else if(headfinderName.equalsIgnoreCase("DybroFrenchHeadFinder")) { return new DybroFrenchHeadFinder();
/** * Go through trees and determine their heads and print them. * Just for debuggin'. <br> * Usage: <code> * java edu.stanford.nlp.trees.CollinsHeadFinder treebankFilePath * </code> * * @param args The treebankFilePath */ public static void main(String[] args) { Treebank treebank = new DiskTreebank(); CategoryWordTag.suppressTerminalDetails = true; treebank.loadPath(args[0]); final HeadFinder chf = new CollinsHeadFinder(); treebank.apply(new TreeVisitor() { public void visitTree(Tree pt) { pt.percolateHeads(chf); pt.pennPrint(); System.out.println(); } }); }
/** * Go through trees and determine their heads and print them. * Just for debuggin'. <br> * Usage: <code> * java edu.stanford.nlp.trees.CollinsHeadFinder treebankFilePath * </code> * * @param args The treebankFilePath */ public static void main(String[] args) { Treebank treebank = new DiskTreebank(); CategoryWordTag.suppressTerminalDetails = true; treebank.loadPath(args[0]); final HeadFinder chf = new CollinsHeadFinder(); treebank.apply(pt -> { pt.percolateHeads(chf); pt.pennPrint(); System.out.println(); }); }
/** * This method just tests the functionality of the included transformers. */ public static void main(String[] args) { //TreeFactory tf = new LabeledScoredTreeFactory(); Tree stringyTree = null; try { stringyTree = (new PennTreeReader(new StringReader("(S (VP (VBZ Try) (NP (DT this))) (. .))"), new LabeledScoredTreeFactory(new StringLabelFactory()))).readTree(); } catch (IOException e) { // do nothing } System.out.println(stringyTree); Function<Tree, Tree> a = getLabeledTreeToCategoryWordTagTreeFunction(); Tree adaptyTree = a.apply(stringyTree); System.out.println(adaptyTree); adaptyTree.percolateHeads(new CollinsHeadFinder()); System.out.println(adaptyTree); Function<Tree, Tree> b = getLabeledTreeToStringLabeledTreeFunction(); Tree stringLabelTree = b.apply(adaptyTree); System.out.println(stringLabelTree); }
/** * Go through trees and determine their heads and print them. * Just for debuggin'. <br> * Usage: <code> * java edu.stanford.nlp.trees.CollinsHeadFinder treebankFilePath * </code> * * @param args The treebankFilePath */ public static void main(String[] args) { Treebank treebank = new DiskTreebank(); CategoryWordTag.suppressTerminalDetails = true; treebank.loadPath(args[0]); final HeadFinder chf = new CollinsHeadFinder(); treebank.apply(pt -> { pt.percolateHeads(chf); pt.pennPrint(); System.out.println(); }); }
/** * This method just tests the functionality of the included transformers. */ public static void main(String[] args) { //TreeFactory tf = new LabeledScoredTreeFactory(); Tree stringyTree = null; try { stringyTree = (new PennTreeReader(new StringReader("(S (VP (VBZ Try) (NP (DT this))) (. .))"), new LabeledScoredTreeFactory(new StringLabelFactory()))).readTree(); } catch (IOException e) { // do nothing } System.out.println(stringyTree); Function<Tree, Tree> a = getLabeledTreeToCategoryWordTagTreeFunction(); Tree adaptyTree = a.apply(stringyTree); System.out.println(adaptyTree); adaptyTree.percolateHeads(new CollinsHeadFinder()); System.out.println(adaptyTree); Function<Tree, Tree> b = getLabeledTreeToStringLabeledTreeFunction(); Tree stringLabelTree = b.apply(adaptyTree); System.out.println(stringLabelTree); }
HeadFinder hf = new CollinsHeadFinder(); if(headFinderClassName != null) { Class[] hfArgClasses = new Class[headFinderArgs.length];
HeadFinder hf = new CollinsHeadFinder(); if(headFinderClassName != null) { Class[] hfArgClasses = new Class[headFinderArgs.length];