use of io.github.vocabhunter.analysis.settings.DocumentListedFile in project VocabHunter by VocabHunter.
the class FilterFileWordsExtractorImpl method extractDocumentListedFile.
private List<String> extractDocumentListedFile(final BaseListedFile baseListedFile) {
DocumentListedFile file = (DocumentListedFile) baseListedFile;
TextGrid grid = textGridManager.readDocument(file.getFile());
return gridWordsExtractor.words(grid.getLines(), FIRST_COLUMN);
}
use of io.github.vocabhunter.analysis.settings.DocumentListedFile in project VocabHunter by VocabHunter.
the class FilterFileModelTranslatorTest method testToDocument.
@Test
public void testToDocument() {
DocumentListedFile file = new DocumentListedFile(FILE);
validateToModel(file, FilterFileMode.DOCUMENT, COLUMNS_DOCUMENT);
}
use of io.github.vocabhunter.analysis.settings.DocumentListedFile in project VocabHunter by VocabHunter.
the class FilterFileModelTranslatorTest method testFromDocument.
@Test
public void testFromDocument() {
FilterFileModel model = new FilterFileModel(FILE, FilterFileMode.DOCUMENT, COLUMNS_DOCUMENT);
validateFromModel(model, new DocumentListedFile(FILE));
}
use of io.github.vocabhunter.analysis.settings.DocumentListedFile in project VocabHunter by VocabHunter.
the class FilterFileModelTranslatorImpl method fromModel.
@Override
public BaseListedFile fromModel(final FilterFileModel model) {
FilterFileMode mode = model.getMode();
Path file = model.getFile();
switch(mode) {
case SESSION_KNOWN:
return new SessionListedFile(file, false);
case SESSION_SEEN:
return new SessionListedFile(file, true);
case EXCEL:
return new ExcelListedFile(file, model.getColumns());
case DOCUMENT:
return new DocumentListedFile(file);
default:
throw new VocabHunterException("Unsupported mode " + mode);
}
}
Aggregations