Revision: 7512
          
http://languagetool.svn.sourceforge.net/languagetool/?rev=7512&view=rev
Author:   milek_pl
Date:     2012-06-26 10:51:19 +0000 (Tue, 26 Jun 2012)
Log Message:
-----------
heh, forgot to flush and close the buffer

Modified Paths:
--------------
    trunk/JLanguageTool/src/dev/org/languagetool/dev/WordTokenizer.java

Modified: trunk/JLanguageTool/src/dev/org/languagetool/dev/WordTokenizer.java
===================================================================
--- trunk/JLanguageTool/src/dev/org/languagetool/dev/WordTokenizer.java 
2012-06-26 10:18:59 UTC (rev 7511)
+++ trunk/JLanguageTool/src/dev/org/languagetool/dev/WordTokenizer.java 
2012-06-26 10:51:19 UTC (rev 7512)
@@ -1,21 +1,21 @@
 /* LanguageTool, a natural language style checker 
-* Copyright (C) 2006 Daniel Naber (http://www.danielnaber.de)
-* 
-* This library is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Lesser General Public
-* License as published by the Free Software Foundation; either
-* version 2.1 of the License, or (at your option) any later version.
-*
-* This library is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this library; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
-* USA
-*/
+ * Copyright (C) 2006 Daniel Naber (http://www.danielnaber.de)
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
+ * USA
+ */
 
 package org.languagetool.dev;
 
@@ -38,23 +38,24 @@
 public final class WordTokenizer {
 
 
-     public static void main(final String[] args) throws IOException {
+    public static void main(final String[] args) throws IOException {
         final WordTokenizer prg = new WordTokenizer();
         if (args.length != 1) {
             System.err.println("Please supply the language code as the only 
argument.");
             System.exit(-1);
         }
         prg.run(args[0]);
-      }
+    }
 
-      private void run(final String lang) throws IOException {
-        
+    private void run(final String lang) throws IOException {
+
         JLanguageTool langTool = new JLanguageTool(
                 Language.getLanguageForShortName(lang));
         BufferedReader in = null;
+        BufferedWriter out = null;
         try {
             in = new BufferedReader(new InputStreamReader(System.in));
-            BufferedWriter out = new BufferedWriter(new 
OutputStreamWriter(System.out));
+            out = new BufferedWriter(new OutputStreamWriter(System.out));
             String line;
             while ((line = in.readLine()) != null) {
                 AnalyzedTokenReadings[] atr = 
langTool.getRawAnalyzedSentence(line).
@@ -62,8 +63,7 @@
                 for (AnalyzedTokenReadings a : atr) {
                     out.write(a.getToken());
                     out.write("\n");
-                }
-                
+                }                                
             }
         }
         catch (IOException e) {
@@ -74,6 +74,10 @@
             if (in != null) {
                 in.close();
             }
+            if (out != null) {
+                out.flush();
+                out.close();
+            }
         }      
     }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Languagetool-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/languagetool-cvs

Reply via email to