private void runOnFile(final String filename, final String encoding,
final boolean listUnknownWords, final boolean xmlFiltering) throws IOException {
boolean oneTime = false;
if (!isStdIn(filename)) {
if (autoDetect) {
Language language = detectLanguageOfFile(filename, encoding);
if (language == null) {
System.err.println("Could not detect language well enough, using English");
language = new English();
}
changeLanguage(language, motherTongue, disabledRules, enabledRules);
System.out.println("Using " + language.getName() + " for file " + filename);
}
final File file = new File(filename);
// run once on file if the file size < MAX_FILE_SIZE or
// when we use the bitext mode (we use a bitext reader
// instead of a direct file access)