Esempio n. 1
0
            public virtual bool Test(IDependency <G, D, N> d)
            {
                /*
                 * log.info("DRF: Checking " + d + ": hasTag?: " +
                 * (d.dependent() instanceof HasTag) + "; value: " +
                 * ((d.dependent() instanceof HasTag)? ((HasTag) d.dependent()).tag(): null));
                 */
                if (d == null)
                {
                    return(false);
                }
                if (!(d.Dependent() is IHasTag))
                {
                    return(false);
                }
                string tag = ((IHasTag)d.Dependent()).Tag();

                return(tagRejectFilter.Test(tag));
            }
Esempio n. 2
0
            public virtual bool Test(IDependency <G, D, N> d)
            {
                /*
                 * log.info("DRF: Checking " + d + ": hasWord?: " +
                 * (d.dependent() instanceof HasWord) + "; value: " +
                 * ((d.dependent() instanceof HasWord)? ((HasWord) d.dependent()).word(): d.dependent().value()));
                 */
                if (d == null)
                {
                    return(false);
                }
                string word = null;

                if (d.Dependent() is IHasWord)
                {
                    word = ((IHasWord)d.Dependent()).Word();
                }
                if (word == null)
                {
                    word = d.Dependent().Value();
                }
                // log.info("Dep: kid is " + ((MapLabel) d.dependent()).toString("value{map}"));
                return(wordRejectFilter.Test(word));
            }
            // Semantics of this method are weird. If accept() returns true, then the dependent is
            // *not* a punctuation item. This filter thus accepts everything except punctuation
            // dependencies.
            public bool Test(IDependency <ILabel, ILabel, object> dep)
            {
                string depString = dep.Dependent().Value();

                return(this._enclosing.punctRejectWordFilter.Test(depString));
            }