@Test public void testStreamEmpty() { assertThrows(VocabHunterException.class, () -> target.analyse(getFile(FILE_EMPTY))); }
public AnalysisResult analyse(final Path file) { Instant start = Instant.now(); String fullText = readText(file); String filename = FileNameTool.filename(file); AnalysisResult result = analyser.analyse(fullText, filename); int count = result.getOrderedUses().size(); Instant end = Instant.now(); Duration duration = Duration.between(start, end); LOG.info("Analysed text and found {} words in {}ms ({})", count, duration.toMillis(), filename); return result; }
FileStreamer { public AnalysisResult analyse(final Path file) { Instant start = Instant.now(); String fullText = readText(file); String filename = FileNameTool.filename(file); AnalysisResult result = analyser.analyse(fullText, filename); int count = result.getOrderedUses().size(); Instant end = Instant.now(); Duration duration = Duration.between(start, end); LOG.info("Analysed text and found {} words in {}ms ({})", count, duration.toMillis(), filename); return result; } }
FileStreamer { public AnalysisResult analyse(final Path file) { Instant start = Instant.now(); String fullText = readText(file); String filename = FileNameTool.filename(file); AnalysisResult result = analyser.analyse(fullText, filename); int count = result.getOrderedUses().size(); Instant end = Instant.now(); Duration duration = Duration.between(start, end); LOG.info("Analysed text and found {} words in {}ms ({})", count, duration.toMillis(), filename); return result; } @Inject  FileStreamer(final TextReader textReader, final Analyser analyser); }
FileStreamer { public AnalysisResult analyse(final Path file) { Instant start = Instant.now(); String fullText = readText(file); String filename = FileNameTool.filename(file); AnalysisResult result = analyser.analyse(fullText, filename); int count = result.getOrderedUses().size(); Instant end = Instant.now(); Duration duration = Duration.between(start, end); LOG.info("Analysed text and found {} words in {}ms ({})", count, duration.toMillis(), filename); return result; } @Inject  FileStreamer(final TextReader textReader, final Analyser analyser); AnalysisResult analyse(final Path file); EnrichedSessionState createNewSession(final Path file); EnrichedSessionState createOrOpenSession(final Path file); }
FileStreamer { public AnalysisResult analyse(final Path file) { Instant start = Instant.now(); String fullText = readText(file); String filename = FileNameTool.filename(file); AnalysisResult result = analyser.analyse(fullText, filename); int count = result.getOrderedUses().size(); Instant end = Instant.now(); Duration duration = Duration.between(start, end); LOG.info("Analysed text and found {} words in {}ms ({})", count, duration.toMillis(), filename); return result; } @Inject  FileStreamer(final TextReader textReader, final Analyser analyser); AnalysisResult analyse(final Path file); EnrichedSessionState createNewSession(final Path file); EnrichedSessionState createOrOpenSession(final Path file);  }