use of io.github.vocabhunter.analysis.settings.ExcelListedFile in project VocabHunter by VocabHunter.
the class FilterFileWordsExtractorImpl method extractExcelListedFile.
private List<String> extractExcelListedFile(final BaseListedFile baseListedFile) {
ExcelListedFile file = (ExcelListedFile) baseListedFile;
TextGrid grid = textGridManager.readExcel(file.getFile());
return gridWordsExtractor.words(grid.getLines(), file.getColumns());
}
use of io.github.vocabhunter.analysis.settings.ExcelListedFile in project VocabHunter by VocabHunter.
the class FilterFileModelTranslatorTest method testFromExcel.
@Test
public void testFromExcel() {
FilterFileModel model = new FilterFileModel(FILE, FilterFileMode.EXCEL, COLUMNS_EXCEL);
validateFromModel(model, new ExcelListedFile(FILE, COLUMNS_EXCEL));
}
use of io.github.vocabhunter.analysis.settings.ExcelListedFile 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);
}
}
use of io.github.vocabhunter.analysis.settings.ExcelListedFile in project VocabHunter by VocabHunter.
the class FilterFileModelTranslatorTest method testToExcel.
@Test
public void testToExcel() {
ExcelListedFile file = new ExcelListedFile(FILE, COLUMNS_EXCEL);
validateToModel(file, FilterFileMode.EXCEL, COLUMNS_EXCEL);
}
Aggregations