String s = intern(WordShapeClassifier.wordShape(word, flags.wordShape, knownLCWords)); fl.set(CoreAnnotations.ShapeAnnotation.class, s); fl.set(CoreAnnotations.CharAnnotation.class,intern(fix(fl.get(CoreAnnotations.CharAnnotation.class)))); } else { fl.set(CoreAnnotations.TextAnnotation.class, intern(fix(fl.get(CoreAnnotations.TextAnnotation.class))));
String s = intern(WordShapeClassifier.wordShape(word, flags.wordShape, knownLCWords)); fl.set(CoreAnnotations.ShapeAnnotation.class, s); fl.set(CoreAnnotations.CharAnnotation.class,intern(fix(fl.get(CoreAnnotations.CharAnnotation.class)))); } else { fl.set(CoreAnnotations.TextAnnotation.class, intern(fix(fl.get(CoreAnnotations.TextAnnotation.class))));
String s = intern(WordShapeClassifier.wordShape(word, flags.wordShape, knownLCWords)); fl.set(CoreAnnotations.ShapeAnnotation.class, s); fl.set(CoreAnnotations.CharAnnotation.class,intern(fix(fl.get(CoreAnnotations.CharAnnotation.class)))); } else { fl.set(CoreAnnotations.TextAnnotation.class, intern(fix(fl.get(CoreAnnotations.TextAnnotation.class)))); fl.set(CoreAnnotations.GoldAnswerAnnotation.class, fl.get(CoreAnnotations.AnswerAnnotation.class));
private void doBasicStuff(List<IN> doc) { int position = 0; for (IN fl : doc) { // position in document fl.set(PositionAnnotation.class, Integer.toString((position++))); // word shape if ((flags.wordShape > WordShapeClassifier.NOWORDSHAPE) && (!flags.useShapeStrings)) { String s = intern(WordShapeClassifier.wordShape(fl.get(TextAnnotation.class), flags.wordShape, knownLCWords)); fl.set(ShapeAnnotation.class, s); } // normalizing and interning // was the following; should presumably now be // if ("CTBSegDocumentReader".equalsIgnoreCase(flags.documentReader)) { if ("edu.stanford.nlp.wordseg.Sighan2005DocumentReaderAndWriter".equalsIgnoreCase(flags.readerAndWriter)) { // for Chinese segmentation, "word" is no use and ignore goldAnswer for memory efficiency. fl.set(CharAnnotation.class,intern(fix(fl.get(CharAnnotation.class)))); } else { fl.set(TextAnnotation.class, intern(fix(fl.get(TextAnnotation.class)))); fl.set(GoldAnswerAnnotation.class, fl.get(AnswerAnnotation.class)); } } }