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

de.uni_leipzig.asv.utils.Output Maven / Gradle / Ivy

Go to download

ASV Toolbox is a modular collection of tools for the exploration of written language data. They work either on word lists or text and solve several linguistic classification and clustering tasks. The topics covered contain language detection, POS-tagging, base form reduction, named entity recognition, and terminology extraction. On a more abstract level, the algorithms deal with various kinds of word similarity, using pattern based and statistical approaches. The collection can be used to work on large real world data sets as well as for studying the underlying algorithms. The ASV Toolbox can work on plain text files and connect to a MySQL database. While it is especially designed to work with corpora of the Leipzig Corpora Collection, it can easily be adapted to other sources.

The newest version!
/*******************************************************************************
 * The MIT License (MIT)

 * Copyright (c) 2007, University of Leipzig, Institut für Informatik,
 * Abteilung Autmatische Sprachverarbeitung

 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to
 * deal in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:

 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.

 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
******************************************************************************/
package de.uni_leipzig.asv.utils;

// standard imports
import java.io.FileOutputStream;
import java.io.PrintStream;

/**
 * This class knows what the settings are and performs output operations for the
 * whole program.
 *
 * @author Stefan Bordag
 * @date 02.04.2002
 */
public class Output {

	/**
	 * No instances of this class.
	 */
	private Output() {
	}

	/**
	 * Prints a newline
	 */
	public static void println() {
		Output.println("");
	}

	/**
	 * Wrapper of the standard print method
	 */
	public static void print(String string) {
		String output = Options.getInstance().getGenOutputFile();
		if (!output.equalsIgnoreCase("stdout")) {
			try {
				PrintStream out = new PrintStream(new FileOutputStream(output,
						true));
				out.print(string);
				out.close();
			} catch (Exception ex) {
				System.err.println("Couldn't open outputfile " + output
						+ " for appending.");
			}
		}
		System.out.print(string);
	}

	/**
	 * The same a the print method, adds a newline
	 */
	public static void println(String string) {
		Output.print(string + "\n");
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy