/** Loads one glossary file. It choose and calls required required reader. */ private List<GlossaryEntry> loadGlossaryFile(final File file) throws Exception { String fname_lower = file.getName().toLowerCase(); if (fname_lower.endsWith(EXT_TSV_DEF)) { Log.logRB("CT_LOADING_GLOSSARY", new Object[] {file.getName()}); return GlossaryReaderTSV.read(file); } else if (fname_lower.endsWith(EXT_TSV_UTF8) || fname_lower.endsWith(EXT_TSV_TXT)) { Log.logRB("CT_LOADING_GLOSSARY", new Object[] {file.getName()}); return GlossaryReaderTSV.read(file); } else if (fname_lower.endsWith(EXT_CSV_UTF8)) { Log.logRB("CT_LOADING_GLOSSARY", new Object[] {file.getName()}); return GlossaryReaderCSV.read(file); } else if (fname_lower.endsWith(EXT_TBX)) { Log.logRB("CT_LOADING_GLOSSARY", new Object[] {file.getName()}); return GlossaryReaderTBX.read(file); } else { return null; } }
/** Loads one glossary file. It choose and calls required required reader. */ private List<GlossaryEntry> loadGlossaryFile(final File file) throws Exception { boolean isPriority = priorityGlossary.equals(file); String fname_lower = file.getName().toLowerCase(); if (fname_lower.endsWith(OConsts.EXT_TSV_DEF)) { Log.logRB("CT_LOADING_GLOSSARY", file.getName()); return GlossaryReaderTSV.read(file, isPriority); } else if (fname_lower.endsWith(OConsts.EXT_TSV_UTF8) || fname_lower.endsWith(OConsts.EXT_TSV_TXT)) { Log.logRB("CT_LOADING_GLOSSARY", file.getName()); return GlossaryReaderTSV.read(file, isPriority); } else if (fname_lower.endsWith(OConsts.EXT_CSV_UTF8)) { Log.logRB("CT_LOADING_GLOSSARY", file.getName()); return GlossaryReaderCSV.read(file, isPriority); } else if (fname_lower.endsWith(OConsts.EXT_TBX)) { Log.logRB("CT_LOADING_GLOSSARY", file.getName()); return GlossaryReaderTBX.read(file, isPriority); } else { return null; } }