/** * Default constructor * @param dictPath The path to the hyphenation dictionary file, * e.g. /usr/share/hyphen/hyph_de_DE.dic * @throws FileNotFoundException if the dictionary file cannot be found. * @throws CompilationException if the encoding of the file is not supported. */ public Hyphenator(File dictionaryFile) throws CompilationException, FileNotFoundException { if (!dictionaryFile.exists()) throw new FileNotFoundException("Dictionary file at " + dictionaryFile.getAbsolutePath() + " doesn't exist."); try { charset = getCharset(dictionaryFile); } catch(UnsupportedCharsetException e) { throw new CompilationException(e); } dictionary = Hyphen.getLibrary().hnj_hyphen_load(dictionaryFile.getAbsolutePath()); }