@@ -10,7 +10,7 @@ import edu.stanford.nlp.process.SerializableFunction; import edu.stanford.nlp.stats.EquivalenceClasser; import edu.stanford.nlp.trees.*; import edu.stanford.nlp.trees.tregex.TregexMatcher; -import edu.stanford.nlp.util.Filter; +import java.util.function.Predicate; import edu.stanford.nlp.util.Index; import java.io.OutputStream; @@ -667,7 +667,7 @@ public abstract class AbstractTreebankParserParams implements TreebankLangParser @Override public GrammaticalStructure getGrammaticalStructure(Tree t, - Filter<String> filter, + Predicate<String> filter, HeadFinder hf) { throw new UnsupportedOperationException("This language does not support GrammaticalStructures or dependencies"); }
@@ -29,7 +29,7 @@ package edu.stanford.nlp.parser.lexparser; import edu.stanford.nlp.io.RuntimeIOException; import edu.stanford.nlp.ling.*; import edu.stanford.nlp.trees.*; -import edu.stanford.nlp.util.Filter; +import java.util.function.Predicate; import edu.stanford.nlp.util.Index; import java.io.IOException; @@ -2344,7 +2344,7 @@ public class EnglishTreebankParserParams extends AbstractTreebankParserParams { @Override public GrammaticalStructure getGrammaticalStructure(Tree t, - Filter<String> filter, + Predicate<String> filter, HeadFinder hf) { return new EnglishGrammaticalStructure(t, filter, hf); }
@@ -4,7 +4,7 @@ import edu.stanford.nlp.process.TokenizerFactory; import edu.stanford.nlp.parser.metrics.AbstractEval; import edu.stanford.nlp.trees.*; import edu.stanford.nlp.ling.*; -import edu.stanford.nlp.util.Filter; +import java.util.function.Predicate; import edu.stanford.nlp.util.Index; import java.io.OutputStream; @@ -234,7 +234,7 @@ public interface TreebankLangParserParams extends TreebankFactory, Serializable * UnsupportedOperationException if the language doesn't support * dependencies or GrammaticalStructures. */ - GrammaticalStructure getGrammaticalStructure(Tree t, Filter<String> filter, + GrammaticalStructure getGrammaticalStructure(Tree t, Predicate<String> filter, HeadFinder hf); boolean supportsBasicDependencies();
@@ -6,7 +6,7 @@ import edu.stanford.nlp.neural.rnn.RNNCoreAnnotations; import edu.stanford.nlp.trees.MemoryTreebank; import edu.stanford.nlp.trees.Tree; import edu.stanford.nlp.util.CollectionUtils; -import edu.stanford.nlp.util.Filter; +import java.util.function.Predicate; import edu.stanford.nlp.util.Generics; /** @@ -48,7 +48,7 @@ public class SentimentUtils { return trees; } - static final Filter<Tree> UNKNOWN_ROOT_FILTER = tree -> { + static final Predicate<Tree> UNKNOWN_ROOT_FILTER = tree -> { int gold = RNNCoreAnnotations.getGoldClass(tree); return gold != -1; };
@@ -10,7 +10,7 @@ import edu.stanford.nlp.trees.LabeledScoredTreeFactory; import edu.stanford.nlp.trees.Tree; import edu.stanford.nlp.trees.TreeFactory; import edu.stanford.nlp.trees.international.arabic.ArabicTreeNormalizer.ArabicEmptyFilter; -import edu.stanford.nlp.util.Filter; +import java.util.function.Predicate; import edu.stanford.nlp.util.Generics; /** @@ -21,7 +21,7 @@ import edu.stanford.nlp.util.Generics; */ public class ATBTreeUtils { - private static final Filter<Tree> emptyFilter = new ArabicEmptyFilter(); + private static final Predicate<Tree> emptyFilter = new ArabicEmptyFilter(); private static final TreeFactory tf = new LabeledScoredTreeFactory(); //The default segmentation marker. Can be changed for processing e.g. IBM Arabic.