/** * The only argument we take is the config file. * * @param args */ public Main(String[] args) { super(args); // the subclass must call the method to process arguments, or the initialization // of field variables is done after the initialization fo the superclass. processArguments(args); }
/** * Produce output in the selected oiutput format. * * @param nerView the view to present. * @param ta the text annotation. * @return the string with the data. */ private String produceOutput(View nerView, TextAnnotation ta) { if (bracketedOutput) return this.produceBracketedAnnotations(nerView, ta); else return this.produceCoNLL2002Annotations(nerView, ta); }
System.out.println("Enter the text to process, or blank line to return to the menu.\n"); } else execute(); break; case '4': inswitch = InputSwitch.MENU; } else { this.processInputString(line); this.getResultProcessor().done();
/** * process the single input string, produce output on standard out if no output directory is * defined, or produce the output in the output directory by the same file name as the input * file, or if a specific output filename is specified, use that name. * * @param data the string to process * @throws Exception if anything goes wrong. */ private void processInputString(String data) throws Exception { data = StringEscapeUtils.unescapeHtml4(data); TextAnnotation ta = tab.createTextAnnotation(data); data = this.produceOutput(this.nerAnnotator.getView(ta), ta); this.getResultProcessor().publish(data, Long.toString(System.currentTimeMillis()) + ".txt"); }
for (; i < files.length; i++) { File infile = files[i]; processInputFile(infile); this.getResultProcessor().done(); while ((i * ratio) > completed) { System.out.println("•"); for (; i < files.length; i++) { File infile = files[i]; processInputFile(infile); this.getResultProcessor().done(); processInputFile(indirectory); this.getResultProcessor().done(); System.out.println("Completed");
System.out.println("Enter the text to process, or blank line to return to the menu.\n"); } else execute(); break; case '4': inswitch = InputSwitch.MENU; } else { this.processInputString(line); this.getResultProcessor().done();
/** * process the single input string, produce output on standard out if no output directory is * defined, or produce the output in the output directory by the same file name as the input * file, or if a specific output filename is specified, use that name. * * @param data the string to process * @throws Exception if anything goes wrong. */ private void processInputString(String data) throws Exception { data = StringEscapeUtils.unescapeHtml4(data); TextAnnotation ta = tab.createTextAnnotation(data); data = this.produceOutput(this.nerAnnotator.getView(ta), ta); this.getResultProcessor().publish(data, Long.toString(System.currentTimeMillis()) + ".txt"); }
for (; i < files.length; i++) { File infile = files[i]; processInputFile(infile); if (start == -1) { System.out.println("Total Files : ••••••••••••••••••••••••••••••••••••••••••••••••••"); this.getResultProcessor().done(); while (completed < 50) { System.out.print("•"); for (; i < files.length; i++) { File infile = files[i]; processInputFile(infile); this.getResultProcessor().done(); long time = System.currentTimeMillis() - start; System.out.println("Produced all annotations, average execution time was "+(long)((double)time/(double)files.length)+" ticks per execution."); processInputFile(indirectory); this.getResultProcessor().done(); System.out.println("Completed");
System.out.println("Enter the text to process, or blank line to return to the menu.\n"); } else execute(); break; case '4': inswitch = InputSwitch.MENU; } else { this.processInputString(line); this.getResultProcessor().done();
/** * process the single input string, produce output on standard out if no output directory is * defined, or produce the output in the output directory by the same file name as the input * file, or if a specific output filename is specified, use that name. * * @param data the string to process * @throws Exception if anything goes wrong. */ private void processInputString(String data) throws Exception { data = StringEscapeUtils.unescapeHtml4(data); TextAnnotation ta = tab.createTextAnnotation(data); data = this.produceOutput(this.nerAnnotator.getView(ta), ta); this.getResultProcessor().publish(data, Long.toString(System.currentTimeMillis()) + ".txt"); }
/** * Produce output in the selected oiutput format. * * @param nerView the view to present. * @param ta the text annotation. * @return the string with the data. */ private String produceOutput(View nerView, TextAnnotation ta) { if (bracketedOutput) return this.produceBracketedAnnotations(nerView, ta); else return this.produceCoNLL2002Annotations(nerView, ta); }
for (; i < files.length; i++) { File infile = files[i]; processInputFile(infile); if (start == -1) { System.out.println("Total Files : ••••••••••••••••••••••••••••••••••••••••••••••••••"); this.getResultProcessor().done(); while (completed < 50) { System.out.print("•"); for (; i < files.length; i++) { File infile = files[i]; processInputFile(infile); this.getResultProcessor().done(); long time = System.currentTimeMillis() - start; System.out.println("Produced all annotations, average execution time was "+(long)((double)time/(double)files.length)+" ticks per execution."); processInputFile(indirectory); this.getResultProcessor().done(); System.out.println("Completed");
/** * The only argument we take is the config file. * * @param args */ public Main(String[] args) { super(args); // the subclass must call the method to process arguments, or the initialization // of field variables is done after the initialization fo the superclass. processArguments(args); }
/** * process the single input file, produce output on standard out if no output directory is * defined, or produce the output in the output directory by the same file name as the input * file, or if a specific output filename is specified, use that name. * * @param infile * @throws Exception */ private void processInputFile(File infile) throws Exception { String s = InFile.readFileText(infile.toString()); s = StringEscapeUtils.unescapeHtml4(s); TextAnnotation ta = tab.createTextAnnotation(s); s = this.produceOutput(this.nerAnnotator.getView(ta), ta); this.getResultProcessor().publish(s, infile.getName()); }
/** * Produce output in the selected oiutput format. * * @param nerView the view to present. * @param ta the text annotation. * @return the string with the data. */ private String produceOutput(View nerView, TextAnnotation ta) { if (bracketedOutput) return this.produceBracketedAnnotations(nerView, ta); else return this.produceCoNLL2002Annotations(nerView, ta); }
/** * The only argument we take is the config file. * * @param args */ public Main(String[] args) { super(args); // the subclass must call the method to process arguments, or the initialization // of field variables is done after the initialization fo the superclass. processArguments(args); }
/** * process the single input file, produce output on standard out if no output directory is * defined, or produce the output in the output directory by the same file name as the input * file, or if a specific output filename is specified, use that name. * * @param infile * @throws Exception */ private void processInputFile(File infile) throws Exception { String s = InFile.readFileText(infile.toString()); s = StringEscapeUtils.unescapeHtml4(s); TextAnnotation ta = tab.createTextAnnotation(s); s = this.produceOutput(this.nerAnnotator.getView(ta), ta); this.getResultProcessor().publish(s, infile.getName()); }