use of io.github.vocabhunter.analysis.model.AnalysisResult in project VocabHunter by VocabHunter.
the class FileStreamer method analyse.
public AnalysisResult analyse(final Path file) {
Instant start = Instant.now();
List<String> stream = lines(file);
String filename = FileNameTool.filename(file);
AnalysisResult result = analyser.analyse(stream, 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;
}
use of io.github.vocabhunter.analysis.model.AnalysisResult in project VocabHunter by VocabHunter.
the class SimpleAnalyserTest method testMixedCase.
@Test
public void testMixedCase() {
AnalysisResult result = analyse(UPPER_CASE, LOWER_CASE);
validate(result, use(LOWER_CASE, 2, LineReference.FIRST, LineReference.SECOND));
}
use of io.github.vocabhunter.analysis.model.AnalysisResult in project VocabHunter by VocabHunter.
the class SimpleAnalyserTest method testSpanish.
@Test
public void testSpanish() {
AnalysisResult result = analyse(LINE_WITH_ACCENTS);
validate(result, use(SPANISH_1, 1, LineReference.FIRST), use(SPANISH_2, 1, LineReference.FIRST), use(SPANISH_4, 1, LineReference.FIRST), use(SPANISH_3, 1, LineReference.FIRST));
}
use of io.github.vocabhunter.analysis.model.AnalysisResult in project VocabHunter by VocabHunter.
the class SimpleAnalyserTest method testExtraSpaces.
@Test
public void testExtraSpaces() {
AnalysisResult result = analyse(LINE_WITH_SPACES);
validate(result, use(WORD_1, 1, LineReference.FIRST), use(WORD_3, 1, LineReference.FIRST), use(WORD_2, 1, LineReference.FIRST));
}
use of io.github.vocabhunter.analysis.model.AnalysisResult in project VocabHunter by VocabHunter.
the class SimpleAnalyserTest method testSingle.
@Test
public void testSingle() {
AnalysisResult result = analyse(WORD_1);
validate(result, use(WORD_1, 1, LineReference.FIRST));
}
Aggregations