package br.ccsl.cogroo.checker;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Locale;
import java.util.Scanner;

import br.ccsl.cogroo.analyzer.AnalyzerI;
import br.ccsl.cogroo.analyzer.ComponentFactory;
import br.ccsl.cogroo.analyzer.Pipe;
import br.ccsl.cogroo.text.Document;

/**
 * 
 */
public class GrammarChecker {
  /**
   * @param args the language to be used, "pt_BR" by default
   * @throws IOException 
   * @throws IllegalArgumentException 
   */
  public static void main(String[] args) throws IllegalArgumentException, IOException {

    long start = System.nanoTime();

    if (args.length != 1) {
      System.err.println("Language is missing! usage: CLI pt_br");
      return;
    }

    ComponentFactory factory = ComponentFactory
        .create(new Locale(args[0]));

    Pipe pipe = (Pipe) factory.createPipe();
    pipe.add(new GrammarCheckerAnalyzer());

    System.out.println("Loading time ["
        + ((System.nanoTime() - start) / 1000000) + "ms]");
    Scanner kb = new Scanner(System.in);
    System.out.print("Enter the sentence: ");
    String input = kb.nextLine();

    while (!input.equals("q")) {
      if (input.equals("0")) {
        input = "Fomos levados à crer que os menino são burro de doer. As menina chegaram.";
      }

      Document document = new CheckDocument();
      document.setText(input);
      pipe.analyze(document);

      System.out.print("Enter the sentence: ");
      input = kb.nextLine();
    }
  }
}

@@ -30,46 +30,8 @@
 r;%0A%0A
-import java.io.FileNotFoundException;%0A
 impo
@@ -110,50 +110,8 @@
 r;%0A%0A
-import br.ccsl.cogroo.analyzer.AnalyzerI;%0A
 impo
@@ -294,16 +294,30 @@
 ram args
+%0A   *         
  the lan
@@ -373,25 +373,24 @@
  IOException
- 
 %0A   * @throw
@@ -415,17 +415,16 @@
 xception
- 
 %0A   */%0A 
@@ -495,16 +495,22 @@
 ception,
+%0A     
  IOExcep
@@ -717,25 +717,16 @@
 tFactory
-%0A        
 .create(

Code format. refs #610