use of io.github.vocabhunter.analysis.simple.SimpleAnalyser in project VocabHunter by VocabHunter.
the class AnalysisSystemTest method setUpClass.
@BeforeClass
public static void setUpClass() throws Exception {
Analyser analyser = new SimpleAnalyser();
FileStreamer target = new FileStreamer(analyser);
URL resource = FileStreamerTest.class.getResource("/" + INPUT_DOCUMENT);
Path file = Paths.get(resource.toURI());
EnrichedSessionState enrichedSession = target.createNewSession(file);
SessionState sessionState = enrichedSession.getState();
words = sessionState.getOrderedUses();
}
use of io.github.vocabhunter.analysis.simple.SimpleAnalyser in project VocabHunter by VocabHunter.
the class VocabHunterConsoleExecutable method processInput.
private static void processInput(final VocabHunterConsoleArguments bean, final PrintWriter out) {
for (String input : bean.getInput()) {
Path file = Paths.get(input);
SimpleAnalyser analyser = new SimpleAnalyser();
FileStreamer streamer = new FileStreamer(analyser);
WordFilter wordFilter = buildFilter(bean);
AnalysisResult model = streamer.analyse(file);
model.getOrderedUses().stream().filter(wordFilter::isShown).forEach(w -> display(out, model.getLines(), w, bean.isHideUses()));
}
}
Aggregations