@@ -119,17 +119,14 @@ A complete example follows.
119119
120120` ` ` java
121121import edu.illinois.cs.cogcomp.core.datastructures.textannotation.TextAnnotation;
122- import edu.illinois.cs.cogcomp.core.utilities.configuration.ResourceManager;
123122import edu.illinois.cs.cogcomp.nlp.utility.TokenizerTextAnnotationBuilder;
123+ import edu.illinois.cs.cogcomp.annotation.AnnotatorException;
124124import edu.illinois.cs.cogcomp.annotation.TextAnnotationBuilder;
125125import edu.illinois.cs.cogcomp.core.datastructures.ViewNames;
126126import edu.illinois.cs.cogcomp.ner.NERAnnotator;
127127import edu.illinois.cs.cogcomp.nlp.tokenizer.StatefulTokenizer;
128- import edu.illinois.cs.cogcomp.ner.LbjTagger.* ;
129128import java.io.IOException;
130129
131- import java.util.Properties;
132-
133130// Filename: App.java
134131public class App
135132{
@@ -146,12 +143,16 @@ public class App
146143 TextAnnotationBuilder tab;
147144 // don' t split on hyphens, as NER models are trained this way
148145 boolean splitOnHyphens = false;
149- tab = new TokenizerTextAnnotationBuilder(new StatefulTokenizer(splitOnHyphens));
146+ tab = new TokenizerTextAnnotationBuilder(new StatefulTokenizer(splitOnHyphens, false ));
150147
151148 TextAnnotation ta = tab.createTextAnnotation(corpus, textId, text1);
152149
153150 NERAnnotator co = new NERAnnotator(ViewNames.NER_CONLL);
154- co.getView(ta);
151+ try {
152+ co.getView(ta);
153+ } catch (AnnotatorException e) {
154+ e.printStackTrace();
155+ }
155156
156157 System.out.println(ta.getView(ViewNames.NER_CONLL));
157158 }
0 commit comments