/** * Construct a new {@code GrammaticalStructure} from an existing parse * tree. The new {@code GrammaticalStructure} has the same tree structure * and label values as the given tree (but no shared storage). As part of * construction, the parse tree is analyzed using definitions from * {@link GrammaticalRelation {@code GrammaticalRelation}} to populate * the new {@code GrammaticalStructure} with as many labeled grammatical * relations as it can. * * Once upon a time this method had an extra parameter as to whether to operate * in a threadsafe manner. We decided that that was a really bad idea, and this * method now always acts in a threadsafe manner. * This method gets used by GrammaticalStructureFactory (by reflection). DON'T DELETE. * * @param t Parse tree to make grammatical structure from * @param puncFilter Filter for punctuation words * @param hf HeadFinder to use when building it */ public EnglishGrammaticalStructure(Tree t, Predicate<String> puncFilter, HeadFinder hf) { // the tree is normalized (for index and functional tag stripping) inside CoordinationTransformer super(t, EnglishGrammaticalRelations.values(), EnglishGrammaticalRelations.valuesLock(), new CoordinationTransformer(hf), hf, puncFilter, Filters.acceptFilter()); }
public static List<GrammaticalRelation> values() { return values(false); }
/** * Construct a new <code>GrammaticalStructure</code> from an existing parse * tree. The new <code>GrammaticalStructure</code> has the same tree structure * and label values as the given tree (but no shared storage). As part of * construction, the parse tree is analyzed using definitions from * {@link GrammaticalRelation <code>GrammaticalRelation</code>} to populate * the new <code>GrammaticalStructure</code> with as many labeled grammatical * relations as it can. * * @param t Parse tree to make grammatical structure from * @param puncFilter Filter for punctuation words * @param hf HeadFinder to use when building it * @param threadSafe Whether or not to support simultaneous instances among multiple * threads */ public EnglishGrammaticalStructure(Tree t, Filter<String> puncFilter, HeadFinder hf, boolean threadSafe) { super((new CoordinationTransformer()).transformTree(t), EnglishGrammaticalRelations.values(threadSafe), threadSafe ? EnglishGrammaticalRelations.valuesLock() : null, hf, puncFilter); }
public static List<GrammaticalRelation> values() { return values(false); }
/** * Construct a new {@code GrammaticalStructure} from an existing parse * tree. The new {@code GrammaticalStructure} has the same tree structure * and label values as the given tree (but no shared storage). As part of * construction, the parse tree is analyzed using definitions from * {@link GrammaticalRelation {@code GrammaticalRelation}} to populate * the new {@code GrammaticalStructure} with as many labeled grammatical * relations as it can. * * Once upon a time this method had an extra parameter as to whether to operate * in a threadsafe manner. We decided that that was a really bad idea, and this * method now always acts in a threadsafe manner. * This method gets used by GrammaticalStructureFactory (by reflection). DON'T DELETE. * * @param t Parse tree to make grammatical structure from * @param puncFilter Filter for punctuation words * @param hf HeadFinder to use when building it */ public EnglishGrammaticalStructure(Tree t, Predicate<String> puncFilter, HeadFinder hf) { // the tree is normalized (for index and functional tag stripping) inside CoordinationTransformer super(t, EnglishGrammaticalRelations.values(), EnglishGrammaticalRelations.valuesLock(), new CoordinationTransformer(hf), hf, puncFilter, Filters.acceptFilter()); }
&& EnglishGrammaticalStructureFactory.class.equals(gsf.getClass())) { SingletonTagset depTags = new SingletonTagset(Dependency.class, "stanford341"); for (GrammaticalRelation r : EnglishGrammaticalRelations.values()) { depTags.add(r.getShortName());
/** * Construct a new {@code GrammaticalStructure} from an existing parse * tree. The new {@code GrammaticalStructure} has the same tree structure * and label values as the given tree (but no shared storage). As part of * construction, the parse tree is analyzed using definitions from * {@link GrammaticalRelation {@code GrammaticalRelation}} to populate * the new {@code GrammaticalStructure} with as many labeled grammatical * relations as it can. * * Once upon a time this method had an extra parameter as to whether to operate * in a threadsafe manner. We decided that that was a really bad idea, and this * method now always acts in a threadsafe manner. * This method gets used by GrammaticalStructureFactory (by reflection). DON'T DELETE. * * @param t Parse tree to make grammatical structure from * @param puncFilter Filter for punctuation words * @param hf HeadFinder to use when building it */ public EnglishGrammaticalStructure(Tree t, Predicate<String> puncFilter, HeadFinder hf) { // the tree is normalized (for index and functional tag stripping) inside CoordinationTransformer super(t, EnglishGrammaticalRelations.values(), EnglishGrammaticalRelations.valuesLock(), new CoordinationTransformer(hf), hf, puncFilter, Filters.acceptFilter()); }
/** * Construct a new <code>GrammaticalStructure</code> from an existing parse * tree. The new <code>GrammaticalStructure</code> has the same tree structure * and label values as the given tree (but no shared storage). As part of * construction, the parse tree is analyzed using definitions from * {@link GrammaticalRelation <code>GrammaticalRelation</code>} to populate * the new <code>GrammaticalStructure</code> with as many labeled grammatical * relations as it can. * * @param t Parse tree to make grammatical structure from * @param puncFilter Filter for punctuation words * @param hf HeadFinder to use when building it * @param threadSafe Whether or not to support simultaneous instances among multiple * threads */ public EnglishGrammaticalStructure(Tree t, Filter<String> puncFilter, HeadFinder hf, boolean threadSafe) { // the tree is normalized (for index and functional tag stripping) inside CoordinationTransformer super((new CoordinationTransformer(hf)).transformTree(t.deepCopy()), EnglishGrammaticalRelations.values(threadSafe), threadSafe ? EnglishGrammaticalRelations.valuesLock() : null, hf, puncFilter); }