@Override
  @SuppressWarnings( { "unchecked" })
  // can't have right types in deserialization
  public void loadClassifier(ObjectInputStream ois, Properties props) throws ClassCastException, IOException,
      ClassNotFoundException {
    labelIndices = (Index<CRFLabel>[]) ois.readObject();
    classIndex = (Index<String>) ois.readObject();
    featureIndex = (Index<String>) ois.readObject();
    flags = (SeqClassifierFlags) ois.readObject();
    featureFactory = (edu.stanford.nlp.sequences.FeatureFactory) ois.readObject();

    if (props != null) {
      flags.setProperties(props, false);
    }
    reinit();

    windowSize = ois.readInt();
    weights = (double[][]) ois.readObject();

    // WordShapeClassifier.setKnownLowerCaseWords((Set) ois.readObject());
    knownLCWords = (Set<String>) ois.readObject();

    if (VERBOSE) {
      System.err.println("windowSize=" + windowSize);
      System.err.println("flags=\n" + flags);
    }
  }
@ Override @ SuppressWarnings ( { "unchecked" } ) public void loadClassifier ( ObjectInputStream ois , Properties props ) throws ClassCastException , IOException , ClassNotFoundException { labelIndices = ( Index < CRFLabel > [ ] ) ois . readObject ( ) ; classIndex = ( Index < String > ) ois . readObject ( ) ; featureIndex = ( Index < String > ) ois . readObject ( ) ; flags = ( SeqClassifierFlags ) ois . readObject ( ) ; featureFactory = ( edu . stanford . nlp . sequences . FeatureFactory ) ois . readObject ( ) ; if ( props != null ) { flags . setProperties ( props , false ) ; } reinit ( ) ; windowSize = ois . readInt ( ) ; weights = ( double [ ] [ ] ) ois . readObject ( ) ; knownLCWords = ( Set < String > ) ois . readObject ( ) ; if ( VERBOSE ) { System . err . println ( "windowSize=" + windowSize ) ; System . err . println ( "flags=\n" + flags ) ; } }
Loads a classifier from the specified InputStream. This version works
quietly (unless VERBOSE is true). If props is non-null then any properties
it specifies override those in the serialized file. However, only some
properties are sensible to change (you shouldn't change how features are
defined).
<p>
<i>Note:</i> This method does not close the ObjectInputStream. (But earlier
versions of the code used to, so beware....)