All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.stanford.nlp.util.DisabledPreferencesFactory Maven / Gradle / Ivy

Go to download

Stanford Parser processes raw text in English, Chinese, German, Arabic, and French, and extracts constituency parse trees.

The newest version!
package edu.stanford.nlp.util;

import java.util.prefs.Preferences;
import java.util.prefs.PreferencesFactory;

/**
 * Returns do-nothing Preferences implementation.  We don't use this
 * facility, so we want to avoid the hassles that come with the JVM's
 * implementation.
 * Taken from: http://www.allaboutbalance.com/disableprefs/index.html
 *
 * @author Robert Slifka
 * @author Christopher Manning
 * @version 2003/03/24
 */
public class DisabledPreferencesFactory implements PreferencesFactory {

  public Preferences systemRoot() {
    return new DisabledPreferences();
  }

  public Preferences userRoot() {
    return new DisabledPreferences();
  }

  public static void install() {
    try {
      System.setProperty("java.util.prefs.PreferencesFactory", "edu.stanford.nlp.util.DisabledPreferencesFactory");
    } catch (SecurityException e) {
      // oh well we couldn't do it...
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy