![JAR search and dependency download from the Maven repository](/logo.png)
edu.berkeley.nlp.util.CharEncUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of berkeleyparser Show documentation
Show all versions of berkeleyparser Show documentation
The Berkeley parser analyzes the grammatical structure of natural language using probabilistic context-free grammars (PCFGs).
The newest version!
package edu.berkeley.nlp.util;
import java.io.*;
public class CharEncUtils {
//private static String charEncoding = "ISO-8859-1";
private static String charEncoding = "UTF-8";
public static String getCharEncoding() { return charEncoding; }
public static void setCharEncoding(String charEncoding) {
if(StrUtils.isEmpty(charEncoding)) return;
CharEncUtils.charEncoding = charEncoding;
LogInfo.updateStdStreams();
}
public static BufferedReader getReader(InputStream in) throws IOException {
return new BufferedReader(new InputStreamReader(in, getCharEncoding()));
}
public static PrintWriter getWriter(OutputStream out) throws IOException {
return new PrintWriter(new OutputStreamWriter(out, getCharEncoding()), true);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy