lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ehatc...@apache.org
Subject cvs commit: jakarta-lucene-sandbox/contributions/WordNet/src/java/org/apache/lucene/wordnet Syns2Index.java
Date Mon, 23 Feb 2004 15:24:13 GMT
ehatcher    2004/02/23 07:24:13

  Modified:    contributions/WordNet/src/java/org/apache/lucene/wordnet
                        Syns2Index.java
  Log:
  upgrading deprecated API call
  
  Revision  Changes    Path
  1.4       +12 -13    jakarta-lucene-sandbox/contributions/WordNet/src/java/org/apache/lucene/wordnet/Syns2Index.java
  
  Index: Syns2Index.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene-sandbox/contributions/WordNet/src/java/org/apache/lucene/wordnet/Syns2Index.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Syns2Index.java	26 Jan 2004 17:29:09 -0000	1.3
  +++ Syns2Index.java	23 Feb 2004 15:24:13 -0000	1.4
  @@ -2,20 +2,21 @@
   
   import org.apache.lucene.analysis.Analyzer;
   import org.apache.lucene.analysis.standard.StandardAnalyzer;
  -import org.apache.lucene.index.IndexWriter;
  -import org.apache.lucene.document.Field;
   import org.apache.lucene.document.Document;
  +import org.apache.lucene.document.Field;
  +import org.apache.lucene.index.IndexWriter;
   
  -import java.io.FileInputStream;
  -import java.io.DataInputStream;
  +import java.io.BufferedReader;
   import java.io.File;
  -import java.util.List;
  +import java.io.FileInputStream;
  +import java.io.InputStreamReader;
  +import java.util.HashMap;
  +import java.util.Iterator;
   import java.util.LinkedList;
  +import java.util.List;
  +import java.util.Map;
   import java.util.Set;
   import java.util.TreeSet;
  -import java.util.Map;
  -import java.util.HashMap;
  -import java.util.Iterator;
   
   /**
    * Convert the prolog file wn_s.pl from the wordnet prolog download
  @@ -85,7 +86,7 @@
   
           System.out.println("Opening Prolog file " + prologFilename);
           final FileInputStream fis = new FileInputStream(prologFilename);
  -        final DataInputStream dis = new DataInputStream(fis);
  +        final BufferedReader br = new BufferedReader(new InputStreamReader(fis));
           String line;
   
           // maps a word to all the "groups" it's in
  @@ -99,10 +100,8 @@
           int mod = 1;
           int row = 1;
           // parse prolog file
  -        while ((line = dis.readLine()) != null)
  +        while ((line = br.readLine()) != null)
           {
  -            String oline = line;
  -
               // occasional progress
               if ((++row) % mod == 0)
               {
  @@ -160,7 +159,7 @@
   
           // close the streams
           fis.close();
  -        dis.close();
  +        br.close();
   
           // create the index
           index(indexDir, word2Nums, num2Words);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message