Skip to content

Commit

Permalink
Fixes ContextSerializerFIMI
Browse files Browse the repository at this point in the history
  • Loading branch information
chdemko committed Jun 26, 2016
1 parent 9da8aeb commit 33f9ce0
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import java.io.BufferedWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.StringTokenizer;

import org.thegalactic.context.Context;
import org.thegalactic.io.Reader;
import org.thegalactic.io.Writer;
Expand All @@ -40,7 +40,7 @@ public final class ContextSerializerFIMI implements Reader<Context>, Writer<Cont
/**
* String extension.
*/
private final static String EXTENSION = "dat";
private static final String EXTENSION = "dat";

/**
* The singleton instance.
Expand Down Expand Up @@ -114,10 +114,8 @@ public void read(final Context context, final BufferedReader file) throws IOExce
final String str = file.readLine();

// Tokenize the line
StringTokenizer tok = new StringTokenizer(str);
while (tok.hasMoreTokens()) {
// Get the next attribute
Integer attribute = Integer.parseInt(tok.nextToken());
for (String token : str.split(" +")) {
Integer attribute = Integer.parseInt(token);
if (!context.containsAttribute(attribute)) {
context.addToAttributes(attribute);
}
Expand Down

0 comments on commit 33f9ce0

Please sign in to comment.