public static void main(String[] args) throws IOException
    {
        String propertiesFilename = args[0]; // banner.properties
        String modelFilename = args[1]; // model.bin
        String inputFilename = args[2];
        String outputFilename = args[3];

        // Get the properties and create the tagger
        BannerProperties properties = BannerProperties.load(propertiesFilename,null);//TODO ren
        Tokenizer tokenizer = properties.getTokenizer();
        CRFTagger tagger = CRFTagger.load(new File(modelFilename), properties.getLemmatiser(), properties.getPosTagger());
        PostProcessor postProcessor = properties.getPostProcessor();

        // Get the input text
        BufferedReader inputReader = new BufferedReader(new FileReader(inputFilename));
        String text = "";
        String line = inputReader.readLine();
        while (line != null)
        {
            text += line.trim() + " ";
            line = inputReader.readLine();
        }
        inputReader.close();

        // Break the input into sentences, tag and write to the output file
        PrintWriter outputWriter = new PrintWriter(new BufferedWriter(new FileWriter(outputFilename)));
        BreakIterator breaker = BreakIterator.getSentenceInstance();
        breaker.setText(text);
        int start = breaker.first();
        for (int end = breaker.next(); end != BreakIterator.DONE; start = end, end = breaker.next())
        {
            String sentenceText = text.substring(start, end).trim();
            if (sentenceText.length() > 0)
            {
                Sentence sentence = new Sentence(null, sentenceText);
                tokenizer.tokenize(sentence);
                tagger.tag(sentence);
                if (postProcessor != null)
                    postProcessor.postProcess(sentence);
                outputWriter.println(sentence.getSGML());
            }
        }
        outputWriter.close();
    }
public static void main ( String [ ] args ) throws IOException { String propertiesFilename = args [ 0 ] ; String modelFilename = args [ 1 ] ; String inputFilename = args [ 2 ] ; String outputFilename = args [ 3 ] ; BannerProperties properties = BannerProperties . load ( propertiesFilename , null ) ; Tokenizer tokenizer = properties . getTokenizer ( ) ; CRFTagger tagger = CRFTagger . load ( new File ( modelFilename ) , properties . getLemmatiser ( ) , properties . getPosTagger ( ) ) ; PostProcessor postProcessor = properties . getPostProcessor ( ) ; BufferedReader inputReader = new BufferedReader ( new FileReader ( inputFilename ) ) ; String text = "" ; String line = inputReader . readLine ( ) ; while ( line != null ) { text += line . trim ( ) + " " ; line = inputReader . readLine ( ) ; } inputReader . close ( ) ; PrintWriter outputWriter = new PrintWriter ( new BufferedWriter ( new FileWriter ( outputFilename ) ) ) ; BreakIterator breaker = BreakIterator . getSentenceInstance ( ) ; breaker . setText ( text ) ; int start = breaker . first ( ) ; for ( int end = breaker . next ( ) ; end != BreakIterator . DONE ; start = end , end = breaker . next ( ) ) { String sentenceText = text . substring ( start , end ) . trim ( ) ; if ( sentenceText . length ( ) > 0 ) { Sentence sentence = new Sentence ( null , sentenceText ) ; tokenizer . tokenize ( sentence ) ; tagger . tag ( sentence ) ; if ( postProcessor != null ) postProcessor . postProcess ( sentence ) ; outputWriter . println ( sentence . getSGML ( ) ) ; } } outputWriter . close ( ) ; }
@param args