@SuppressWarnings("unchecked")
    public void load(File modelDirectory, String modelPrefix) throws JChunkerException {
        ObjectInputStream featDictClassInputStream = null;
        
        try {
            featDictClassInputStream = new ObjectInputStream(new FileInputStream(new File(modelDirectory, modelPrefix + FEAT_DICTIONARY_CLASS_FILE_EXTENSION)));
            
            // Get the feature dictionary's class name.
            String featDictClassName = featDictClassInputStream.readUTF();
            
            // Load the feature dictionary's class.
            Class<? extends FeatDictionary> featDictionaryClass = (Class<? extends FeatDictionary>) Class.forName(featDictClassName);
            featDictionary = featDictionaryClass.newInstance();
            
            // Load the feature dictionary.
            featDictionary.load(modelDirectory, modelPrefix);
        } catch (FileNotFoundException e) {
            throw new JChunkerException("The feature dictionary settings file was not found.", e);
        } catch (IOException e) {
            throw new JChunkerException("An error occurred when loading the feature dictionary settings.", e);
        } catch (ClassNotFoundException e) {
            throw new JChunkerException("The feature dictionary's class could not be found.", e);
        } catch (InstantiationException e) {
            throw new JChunkerException("The feature dictionary's class could not be instantiated.", e);
        } catch (IllegalAccessException e) {
            throw new JChunkerException("The feature dictionary's class was not accessed properly.", e);
        } finally {
            try {
                featDictClassInputStream.close();
            } catch (IOException e) {
                throw new JChunkerException("An error occurred when closing the feature dictionary's settings file.", e);
            }
        }
    }