Sha256: c775bc11d0b20df76719694606e32b6f0780ce6009ef2e24879d3f7b0ba46b68

Contents?: true

Size: 851 Bytes

Versions: 5

Compression:

Stored size: 851 Bytes

Contents

import edu.stanford.nlp.ling.CoreAnnotation;
import edu.stanford.nlp.util.ArrayCoreMap;
import java.util.Properties;
import edu.stanford.nlp.pipeline.StanfordCoreNLP;

// export JAVA_HOME='/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home'
// javac -cp '.:stanford-corenlp.jar' AnnotationBridge.java
// jar cf bridge.jar AnnotationBridge.class
public class AnnotationBridge {
    
    public static Object getAnnotation(Object entity, String name) throws ClassNotFoundException {
      Class<CoreAnnotation> klass;
      klass = (Class<CoreAnnotation>) Class.forName(name);
      Object object = ((ArrayCoreMap) entity).get(klass);
      return object;
    }
    
    public static Object getPipelineWithProperties(Properties properties) {
      StanfordCoreNLP pipeline = new StanfordCoreNLP(properties);
      return pipeline;
    }
}

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
stanford-core-nlp-3.5.0.alpha bin/AnnotationBridge.java
stanford-core-nlp-0.5.3 bin/AnnotationBridge.java
stanford-core-nlp-abstractor-0.5.3 bin/AnnotationBridge.java
stanford-core-nlp-0.5.1 bin/AnnotationBridge.java
stanford-core-nlp-0.5.0 bin/AnnotationBridge.java