From 99ffd3cf27b63d02f3964599422e2fd4e5922a79 Mon Sep 17 00:00:00 2001 From: Erik Hatcher Date: Tue, 30 Sep 2003 03:09:15 +0000 Subject: [PATCH] #23505 - Hani's patch to fix RussianAnalyzer test git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150069 13f79535-47bb-0310-9956-ffa450edef68 --- .../analysis/ru/TestRussianAnalyzer.java | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/test/org/apache/lucene/analysis/ru/TestRussianAnalyzer.java b/src/test/org/apache/lucene/analysis/ru/TestRussianAnalyzer.java index 69ce17a0f26..ab536fd590c 100644 --- a/src/test/org/apache/lucene/analysis/ru/TestRussianAnalyzer.java +++ b/src/test/org/apache/lucene/analysis/ru/TestRussianAnalyzer.java @@ -56,11 +56,7 @@ package org.apache.lucene.analysis.ru; import junit.framework.TestCase; -import java.io.FileReader; - -import java.io.InputStreamReader; -import java.io.FileInputStream; -import java.io.IOException; +import java.io.*; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.Token; @@ -78,13 +74,13 @@ public class TestRussianAnalyzer extends TestCase private InputStreamReader sampleUnicode; - private FileReader inWordsKOI8; + private Reader inWordsKOI8; - private FileReader sampleKOI8; + private Reader sampleKOI8; - private FileReader inWords1251; + private Reader inWords1251; - private FileReader sample1251; + private Reader sample1251; public TestRussianAnalyzer(String name) { @@ -155,9 +151,9 @@ public class TestRussianAnalyzer extends TestCase //System.out.println(new java.util.Date()); RussianAnalyzer ra = new RussianAnalyzer(RussianCharsets.KOI8); // KOI8 - inWordsKOI8 = new FileReader("src/test/org/apache/lucene/analysis/ru/testKOI8.txt"); + inWordsKOI8 = new InputStreamReader(new FileInputStream("src/test/org/apache/lucene/analysis/ru/testKOI8.txt"), "iso-8859-1"); - sampleKOI8 = new FileReader("src/test/org/apache/lucene/analysis/ru/resKOI8.htm"); + sampleKOI8 = new InputStreamReader(new FileInputStream("src/test/org/apache/lucene/analysis/ru/resKOI8.htm"), "iso-8859-1"); TokenStream in = ra.tokenStream("all", inWordsKOI8); RussianLetterTokenizer sample = @@ -191,9 +187,9 @@ public class TestRussianAnalyzer extends TestCase public void test1251() throws IOException { // 1251 - inWords1251 = new FileReader("src/test/org/apache/lucene/analysis/ru/test1251.txt"); + inWords1251 = new InputStreamReader(new FileInputStream("src/test/org/apache/lucene/analysis/ru/test1251.txt"), "iso-8859-1"); - sample1251 = new FileReader("src/test/org/apache/lucene/analysis/ru/res1251.htm"); + sample1251 = new InputStreamReader(new FileInputStream("src/test/org/apache/lucene/analysis/ru/res1251.htm"), "iso-8859-1"); RussianAnalyzer ra = new RussianAnalyzer(RussianCharsets.CP1251); TokenStream in = ra.tokenStream("", inWords1251);