package com.diskoverorta.osdep;

import edu.stanford.nlp.ie.AbstractSequenceClassifier;
import edu.stanford.nlp.ie.crf.CRFClassifier;
import edu.stanford.nlp.ling.CoreLabel;

import java.util.List;

/**
 * Created by praveen on 15/10/14.
 */
public class StanfordNERTagger
{
    String stanfordNERClassifier = "english.muc.7class.distsim.crf.ser.gz";
    static AbstractSequenceClassifier<CoreLabel> nerClassifier = null;

    public StanfordNERTagger()
    {
        try {
            if (nerClassifier == null)
                nerClassifier = CRFClassifier.getClassifier(stanfordNERClassifier);
        }catch(Exception ex)
        {
            ex.printStackTrace();
        }
    }
    public List<List<CoreLabel>> getNERTaggedOutput(String str)
    {
        return nerClassifier.classify(str);
    }
}

@@ -271,44 +271,79 @@
 er%0A%7B
+   
 %0A    
-String stanfordNERClassifier = 
+URL url = StanfordNERTagger.class.getClassLoader().getResource(
 %22eng
@@ -377,17 +377,51 @@
 .ser.gz%22
-;
+); %0A%09String s = url.getPath();%0A    
 %0A    sta
@@ -640,28 +640,8 @@
 er(s
-tanfordNERClassifier
 );%0A 

Update StanfordNERTagger.java