lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r1228698 - in /lucene/dev/branches/lucene3305/modules/analysis/kuromoji/src: java/org/apache/lucene/analysis/kuromoji/dict/ test/org/apache/lucene/analysis/kuromoji/ test/org/apache/lucene/analysis/kuromoji/dict/
Date Sat, 07 Jan 2012 18:46:49 GMT
Author: uschindler
Date: Sat Jan  7 18:46:48 2012
New Revision: 1228698

URL: http://svn.apache.org/viewvc?rev=1228698&view=rev
Log:
LUCENE-3305: Use UTF-8 java.nio.CharSet instance constant from IOUtils

Modified:
    lucene/dev/branches/lucene3305/modules/analysis/kuromoji/src/java/org/apache/lucene/analysis/kuromoji/dict/UserDictionary.java
    lucene/dev/branches/lucene3305/modules/analysis/kuromoji/src/test/org/apache/lucene/analysis/kuromoji/TestQuality.java
    lucene/dev/branches/lucene3305/modules/analysis/kuromoji/src/test/org/apache/lucene/analysis/kuromoji/dict/UserDictionaryTest.java

Modified: lucene/dev/branches/lucene3305/modules/analysis/kuromoji/src/java/org/apache/lucene/analysis/kuromoji/dict/UserDictionary.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3305/modules/analysis/kuromoji/src/java/org/apache/lucene/analysis/kuromoji/dict/UserDictionary.java?rev=1228698&r1=1228697&r2=1228698&view=diff
==============================================================================
--- lucene/dev/branches/lucene3305/modules/analysis/kuromoji/src/java/org/apache/lucene/analysis/kuromoji/dict/UserDictionary.java
(original)
+++ lucene/dev/branches/lucene3305/modules/analysis/kuromoji/src/java/org/apache/lucene/analysis/kuromoji/dict/UserDictionary.java
Sat Jan  7 18:46:48 2012
@@ -49,7 +49,7 @@ public final class UserDictionary implem
     IOException priorE = null;
     final InputStream is = new FileInputStream(filename);
     try {
-      final Reader r = new InputStreamReader(is, "UTF-8");
+      final Reader r = new InputStreamReader(is, IOUtils.CHARSET_UTF_8);
       read(r);
     } catch (IOException ioe) {
       priorE = ioe;

Modified: lucene/dev/branches/lucene3305/modules/analysis/kuromoji/src/test/org/apache/lucene/analysis/kuromoji/TestQuality.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3305/modules/analysis/kuromoji/src/test/org/apache/lucene/analysis/kuromoji/TestQuality.java?rev=1228698&r1=1228697&r2=1228698&view=diff
==============================================================================
--- lucene/dev/branches/lucene3305/modules/analysis/kuromoji/src/test/org/apache/lucene/analysis/kuromoji/TestQuality.java
(original)
+++ lucene/dev/branches/lucene3305/modules/analysis/kuromoji/src/test/org/apache/lucene/analysis/kuromoji/TestQuality.java
Sat Jan  7 18:46:48 2012
@@ -33,6 +33,7 @@ import org.apache.lucene.analysis.Analyz
 import org.apache.lucene.analysis.TokenStream;
 import org.apache.lucene.analysis.kuromoji.Tokenizer.Mode;
 import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+import org.apache.lucene.util.IOUtils;
 import org.apache.lucene.util.LuceneTestCase;
 
 // nocommit: we don't need this or its huge files i dont think?
@@ -43,9 +44,9 @@ public class TestQuality extends LuceneT
     File datafile = getDataFile("tanakaseg.zip");
     ZipFile zip = new ZipFile(datafile);
     InputStream is = zip.getInputStream(zip.getEntry("sentences.txt"));
-    BufferedReader unseg = new BufferedReader(new InputStreamReader(is, "UTF-8"));
+    BufferedReader unseg = new BufferedReader(new InputStreamReader(is, IOUtils.CHARSET_UTF_8));
     InputStream is2 = zip.getInputStream(zip.getEntry("segmented.txt"));
-    BufferedReader seg = new BufferedReader(new InputStreamReader(is2, "UTF-8"));
+    BufferedReader seg = new BufferedReader(new InputStreamReader(is2, IOUtils.CHARSET_UTF_8));
     Stats stats = new Stats();
     /**
      #words: 1578506

Modified: lucene/dev/branches/lucene3305/modules/analysis/kuromoji/src/test/org/apache/lucene/analysis/kuromoji/dict/UserDictionaryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3305/modules/analysis/kuromoji/src/test/org/apache/lucene/analysis/kuromoji/dict/UserDictionaryTest.java?rev=1228698&r1=1228697&r2=1228698&view=diff
==============================================================================
--- lucene/dev/branches/lucene3305/modules/analysis/kuromoji/src/test/org/apache/lucene/analysis/kuromoji/dict/UserDictionaryTest.java
(original)
+++ lucene/dev/branches/lucene3305/modules/analysis/kuromoji/src/test/org/apache/lucene/analysis/kuromoji/dict/UserDictionaryTest.java
Sat Jan  7 18:46:48 2012
@@ -25,6 +25,7 @@ import java.io.IOException;
 
 import org.apache.lucene.analysis.kuromoji.TokenizerTest;
 import org.apache.lucene.analysis.kuromoji.dict.UserDictionary;
+import org.apache.lucene.util.IOUtils;
 import org.apache.lucene.util.LuceneTestCase;
 import org.junit.Test;
 
@@ -35,7 +36,7 @@ public class UserDictionaryTest extends 
     if (is == null)
       throw new FileNotFoundException("Cannot find userdict.txt in test classpath!");
     try {
-      Reader reader = new InputStreamReader(is, "UTF-8");
+      Reader reader = new InputStreamReader(is, IOUtils.CHARSET_UTF_8);
       return new UserDictionary(reader);
     } finally {
       is.close();



Mime
View raw message