You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2011/02/21 16:14:46 UTC
svn commit: r1073007 -
/lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/automaton/fst/TestFSTs.java
Author: dweiss
Date: Mon Feb 21 15:14:46 2011
New Revision: 1073007
URL: http://svn.apache.org/viewvc?rev=1073007&view=rev
Log:
LUCENE-2933: Correcting test case calling toDot().
Modified:
lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/automaton/fst/TestFSTs.java
Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/automaton/fst/TestFSTs.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/automaton/fst/TestFSTs.java?rev=1073007&r1=1073006&r2=1073007&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/automaton/fst/TestFSTs.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/automaton/fst/TestFSTs.java Mon Feb 21 15:14:46 2011
@@ -20,9 +20,11 @@ package org.apache.lucene.util.automaton
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
+import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
-import java.io.PrintStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -445,9 +447,9 @@ public class TestFSTs extends LuceneTest
}
if (VERBOSE && pairs.size() <= 20 && fst != null) {
- PrintStream ps = new PrintStream("out.dot");
- Util.toDot(fst, ps);
- ps.close();
+ Writer w = new OutputStreamWriter(new FileOutputStream("out.dot"), "UTF-8");
+ Util.toDot(fst, w, false, false);
+ w.close();
System.out.println("SAVED out.dot");
}
@@ -1128,9 +1130,9 @@ public class TestFSTs extends LuceneTest
System.out.println(ord + " terms; " + fst.getNodeCount() + " nodes; " + fst.getArcCount() + " arcs; " + fst.getArcWithOutputCount() + " arcs w/ output; tot size " + fst.sizeInBytes());
if (fst.getNodeCount() < 100) {
- PrintStream ps = new PrintStream("out.dot");
- Util.toDot(fst, ps);
- ps.close();
+ Writer w = new OutputStreamWriter(new FileOutputStream("out.dot"), "UTF-8");
+ Util.toDot(fst, w, false, false);
+ w.close();
System.out.println("Wrote FST to out.dot");
}