public static int loadSerialized(String filename){
  Annotation annotation=IOTools.deserialize(filename,Annotation.class);
  List<CoreMap> sentenceList=annotation.get(CoreAnnotations.SentencesAnnotation.class);
  if (sentenceList == null) {
    throw new RuntimeException("Unusable annotation (no sentences) in " + filename);
  }
  annotationMap=new HashMap<Integer,CoreMap>(sentenceList.size());
  int maxLineId=0;
  for (  CoreMap annotationSet : sentenceList) {
    int lineId=annotationSet.get(CoreAnnotations.LineNumberAnnotation.class);
    maxLineId=lineId > maxLineId ? lineId : maxLineId;
    annotationMap.put(lineId - 1,annotationSet);
  }
  return maxLineId + 1;
}

public static int loadSerialized ( String filename ) { Annotation annotation = IOTools . deserialize ( filename , Annotation . class ) ; List < CoreMap > sentenceList = annotation . get ( CoreAnnotations . SentencesAnnotation . class ) ; if ( sentenceList == null ) { throw new RuntimeException ( "Unusable annotation (no sentences) in " + filename ) ; } annotationMap = new HashMap < Integer , CoreMap > ( sentenceList . size ( ) ) ; int maxLineId = 0 ; for ( CoreMap annotationSet : sentenceList ) { int lineId = annotationSet . get ( CoreAnnotations . LineNumberAnnotation . class ) ; maxLineId = lineId > maxLineId ? lineId : maxLineId ; annotationMap . put ( lineId - 1 , annotationSet ) ; } return maxLineId + 1 ; }
load serialized corenlp annotations from a file .
