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

edu.stanford.nlp.util.logging.StanfordRedwoodConfiguration Maven / Gradle / Ivy

Go to download

Stanford CoreNLP provides a set of natural language analysis tools which can take raw English language text input and give the base forms of words, their parts of speech, whether they are names of companies, people, etc., normalize dates, times, and numeric quantities, mark up the structure of sentences in terms of phrases and word dependencies, and indicate which noun phrases refer to the same entities. It provides the foundational building blocks for higher level text understanding applications.

There is a newer version: 4.5.7
Show newest version

package edu.stanford.nlp.util.logging;

import java.util.Properties;

/**
 * @author Gabor Angeli (angeli at cs.stanford)
 */
public class StanfordRedwoodConfiguration extends RedwoodConfiguration {

  /**
   * Private constructor to prevent use of "new StanfordRedwoodConfiguration()"
   */
  private StanfordRedwoodConfiguration() {
    super();
  }

  /**
   * Configures the Redwood logger using a reasonable set of defaults,
   * which can be overruled by the supplied Properties file.
   *
   * @param props The properties file to overrule or augment the default configuration
   */
  public static void apply(Properties props){
    //--Tweak Properties
    //(output to stderr)
    if (props.getProperty("log.output") == null) {
      props.setProperty("log.output", "stderr");
    }
    //(capture system streams)
    if (props.getProperty("log.captureStderr") == null) {
      props.setProperty("log.captureStderr", "true");
    }
    //(apply properties)
    RedwoodConfiguration.apply(props);

    //--Strange Tweaks
    //(adapt legacy logging systems)
    JavaUtilLoggingAdaptor.adapt();
  }

  /**
   * Set up the Redwood logger with Stanford's default configuration
   */
  public static void setup(){
    apply(new Properties());
  }

  public static void minimalSetup(){
    Properties props = new Properties();
    props.setProperty("log.output", "stderr");
    RedwoodConfiguration.apply(props);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy