From a38519c998f7f56839af5ce0153805a590a61ea6 Mon Sep 17 00:00:00 2001 From: Sasha Fedchin Date: Mon, 29 Jul 2024 12:31:06 +0200 Subject: [PATCH] Debugging --- src/acrostics/LanguageModel.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/acrostics/LanguageModel.java b/src/acrostics/LanguageModel.java index 0f6a9bf..c4fd095 100644 --- a/src/acrostics/LanguageModel.java +++ b/src/acrostics/LanguageModel.java @@ -2,6 +2,7 @@ import java.io.File; import java.nio.charset.StandardCharsets; +import java.nio.file.Paths; import java.util.Arrays; import java.util.HashMap; import java.util.Scanner; @@ -19,7 +20,7 @@ public LanguageModel(String filename) { filename = filename + FILE_POSTFIX; System.err.println("In constructor"); try { - Scanner sc = new Scanner(new File(filename)); + Scanner sc = new Scanner(Paths.get(filename), StandardCharsets.UTF_8); System.err.println("Reading file: " + filename); System.err.println("Reading file: " + new File(filename).getAbsolutePath()); while (sc.hasNextLine()) {