Skip to content

Commit

Permalink
Debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Dargones committed Jul 29, 2024
1 parent 9ae5402 commit 2e31a9f
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/acrostics/LanguageModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,13 @@ public class LanguageModel {

public LanguageModel(String filename) {
filename = filename + FILE_POSTFIX;
System.err.println("In constructor");
try {
Scanner sc = new Scanner(Paths.get(filename), "UTF-8");
System.err.println("Reading file: " + filename);
System.err.println("Reading file: " + new File(filename).getAbsolutePath());
while (sc.hasNextLine()) {
String[] line = sc.nextLine().split("\t");
if ((line.length == 0) || Arrays.stream(TOKENS_TO_IGNORE).anyMatch(token -> token.equals(line[0]))) {
System.err.println("Skipping line");
continue;
}
System.err.println("Adding a token");
tokenFrequencies.put(line[0], Math.pow(Math.E, Double.parseDouble(line[1]))); // TODO: Use logs
}
} catch (Exception e) {
Expand Down

0 comments on commit 2e31a9f

Please sign in to comment.