void process() { ObjectStream<String> untokenizedLineStream; ObjectStream<String> tokenizedLineStream; PerformanceMonitor perfMon = null; try { untokenizedLineStream = new PlainTextByLineStream(new SystemInputStreamFactory(), SystemInputStreamFactory.encoding()); tokenizedLineStream = new WhitespaceTokenStream( new TokenizerStream(tokenizer, untokenizedLineStream)); perfMon = new PerformanceMonitor(System.err, "sent"); perfMon.start(); String tokenizedLine; while ((tokenizedLine = tokenizedLineStream.read()) != null) { System.out.println(tokenizedLine); perfMon.incrementCounter(); } } catch (IOException e) { CmdLineUtil.handleStdinIoError(e); } perfMon.stopAndPrintFinalResult(); } }
listeners.toArray(new ChunkerEvaluationMonitor[listeners.size()])); final PerformanceMonitor monitor = new PerformanceMonitor("sent"); monitor.startAndPrintThroughput(); monitor.stopAndPrintFinalResult();
public void incrementCounter(int increment) { if (!isStarted()) throw new IllegalStateException("Must be started first!"); if (increment < 0) throw new IllegalArgumentException("increment must be zero or positive but was " + increment + "!"); counter += increment; }
public void incrementCounter() { incrementCounter(1); }
public void startAndPrintThroughput() { start();
public DocumentSample read() throws IOException { monitor.incrementCounter(); return sampleStream.read(); }
public void startAndPrintThroughput() { start();
lineStream = new PlainTextByLineStream(new SystemInputStreamFactory(), SystemInputStreamFactory.encoding()); perfMon = new PerformanceMonitor(System.err, "nglm"); perfMon.start(); String line; while ((line = lineStream.read()) != null) { "next:" + Arrays.toString(predicted)); perfMon.incrementCounter(); perfMon.stopAndPrintFinalResult();
listeners.toArray(new LanguageDetectorEvaluationMonitor[listeners.size()])); final PerformanceMonitor monitor = new PerformanceMonitor("doc"); monitor.startAndPrintThroughput(); monitor.stopAndPrintFinalResult();
public ChunkSample read() throws IOException { monitor.incrementCounter(); return sampleStream.read(); }
public void startAndPrintThroughput() { start();
public void start() { if (isStarted()) throw new IllegalStateException("Already started!"); startTime = System.currentTimeMillis(); }
new PlainTextByLineStream(new SystemInputStreamFactory(), SystemInputStreamFactory.encoding())) { PerformanceMonitor perfMon = new PerformanceMonitor(System.err, "sent"); perfMon.start(); perfMon.incrementCounter(); perfMon.stopAndPrintFinalResult();
listeners.toArray(new DoccatEvaluationMonitor[listeners.size()])); final PerformanceMonitor monitor = new PerformanceMonitor("doc"); monitor.startAndPrintThroughput(); monitor.stopAndPrintFinalResult();
public NameSample read() throws IOException { monitor.incrementCounter(); return sampleStream.read(); }
public void stopAndPrintFinalResult() { if (!isStarted()) throw new IllegalStateException("Must be started first!");
PerformanceMonitor perfMon = new PerformanceMonitor(System.err, "sent"); perfMon.start(); perfMon.incrementCounter(sents.length); perfMon.stopAndPrintFinalResult();
listeners.toArray(new TokenNameFinderEvaluationMonitor[listeners.size()])); final PerformanceMonitor monitor = new PerformanceMonitor("sent"); monitor.startAndPrintThroughput(); monitor.stopAndPrintFinalResult();
public LanguageSample read() throws IOException { monitor.incrementCounter(); return sampleStream.read(); }
public void incrementCounter(int increment) { if (!isStarted()) throw new IllegalStateException("Must be started first!"); if (increment < 0) throw new IllegalArgumentException("increment must be zero or positive but was " + increment + "!"); counter += increment; }