All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ggp.base.util.gdl.model.SentenceForms Maven / Gradle / Ivy

There is a newer version: 0.0.15
Show newest version
package org.ggp.base.util.gdl.model;

import java.util.Collection;
import java.util.Set;

import org.ggp.base.util.gdl.grammar.GdlPool;

import com.google.common.base.Predicate;
import com.google.common.collect.Sets;

public class SentenceForms {
    private SentenceForms() {}

    public static final Predicate TRUE_PRED = new Predicate() {
        @Override
        public boolean apply(SentenceForm input) {
            return input.getName() == GdlPool.TRUE;
        }
    };
    public static final Predicate DOES_PRED = new Predicate() {
        @Override
        public boolean apply(SentenceForm input) {
            return input.getName() == GdlPool.DOES;
        }
    };

    public static Set getNames(Collection forms) {
        Set names = Sets.newHashSet();
        for (SentenceForm form : forms) {
            names.add(form.getName().getValue());
        }
        return names;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy