Search in sources :

Example 1 with CorelexFeatureExtractor

use of edu.illinois.cs.cogcomp.edison.features.factory.CorelexFeatureExtractor in project cogcomp-nlp by CogComp.

the class TestCorlex method test.

public final void test() throws EdisonException {
    log.debug("Corlex Feature Extractor");
    // Using the first TA and a constituent between span of 30-40 as a test
    TextAnnotation ta = tas.get(1);
    View TOKENS = ta.getView("TOKENS");
    log.debug("Got tokens FROM TextAnnotation");
    CorelexFeatureExtractor testInstance = new CorelexFeatureExtractor(true);
    Set<Feature> feats = testInstance.getWordFeatures(ta, 1);
    String[] expected_outputs = { "atr" };
    if (feats == null) {
        log.debug("Feats are returning NULL.");
    }
    log.debug("Printing Set of Features");
    for (Feature f : feats) {
        log.debug(f.getName());
        assertTrue(ArrayUtils.contains(expected_outputs, f.getName()));
    }
}
Also used : CorelexFeatureExtractor(edu.illinois.cs.cogcomp.edison.features.factory.CorelexFeatureExtractor) TextAnnotation(edu.illinois.cs.cogcomp.core.datastructures.textannotation.TextAnnotation) View(edu.illinois.cs.cogcomp.core.datastructures.textannotation.View) Feature(edu.illinois.cs.cogcomp.edison.features.Feature)

Aggregations

TextAnnotation (edu.illinois.cs.cogcomp.core.datastructures.textannotation.TextAnnotation)1 View (edu.illinois.cs.cogcomp.core.datastructures.textannotation.View)1 Feature (edu.illinois.cs.cogcomp.edison.features.Feature)1 CorelexFeatureExtractor (edu.illinois.cs.cogcomp.edison.features.factory.CorelexFeatureExtractor)1