/** * @param key * @return a hyphenation tree */ public static HyphenationTree getFileHyphenationTree(String key) { try { if (hyphenDir == null) return null; InputStream stream = null; File hyphenFile = new File(hyphenDir, key + ".xml"); if (hyphenFile.canRead()) stream = new FileInputStream(hyphenFile); if (stream == null && key.length() > 2) { hyphenFile = new File(hyphenDir, key.substring(0, 2) + ".xml"); if (hyphenFile.canRead()) stream = new FileInputStream(hyphenFile); } if (stream == null) return null; HyphenationTree hTree = new HyphenationTree(); hTree.loadSimplePatterns(stream); return hTree; } catch (Exception e) { return null; } }
/** * @param key * @return a hyphenation tree */ public static HyphenationTree getFileHyphenationTree(String key) { try { if (hyphenDir == null) return null; InputStream stream = null; File hyphenFile = new File(hyphenDir, key + ".xml"); if (hyphenFile.canRead()) stream = new FileInputStream(hyphenFile); if (stream == null && key.length() > 2) { hyphenFile = new File(hyphenDir, key.substring(0, 2) + ".xml"); if (hyphenFile.canRead()) stream = new FileInputStream(hyphenFile); } if (stream == null) return null; HyphenationTree hTree = new HyphenationTree(); hTree.loadSimplePatterns(stream); return hTree; } catch (Exception e) { return null; } }
/** * @param key * @return a hyphenation tree */ public static HyphenationTree getFileHyphenationTree(String key) { try { if (hyphenDir == null) return null; InputStream stream = null; File hyphenFile = new File(hyphenDir, key + ".xml"); if (hyphenFile.canRead()) stream = new FileInputStream(hyphenFile); if (stream == null && key.length() > 2) { hyphenFile = new File(hyphenDir, key.substring(0, 2) + ".xml"); if (hyphenFile.canRead()) stream = new FileInputStream(hyphenFile); } if (stream == null) return null; HyphenationTree hTree = new HyphenationTree(); hTree.loadSimplePatterns(stream); return hTree; } catch (Exception e) { return null; } }
/** * @param key * @return a hyphenation tree */ public static HyphenationTree getResourceHyphenationTree(String key) { try { InputStream stream = BaseFont.getResourceStream(defaultHyphLocation + key + ".xml"); if (stream == null && key.length() > 2) stream = BaseFont.getResourceStream(defaultHyphLocation + key.substring(0, 2) + ".xml"); if (stream == null) return null; HyphenationTree hTree = new HyphenationTree(); hTree.loadSimplePatterns(stream); return hTree; } catch (Exception e) { return null; } }
/** * @param key * @return a hyphenation tree */ public static HyphenationTree getResourceHyphenationTree(String key) { try { InputStream stream = BaseFont.getResourceStream(defaultHyphLocation + key + ".xml"); if (stream == null && key.length() > 2) stream = BaseFont.getResourceStream(defaultHyphLocation + key.substring(0, 2) + ".xml"); if (stream == null) return null; HyphenationTree hTree = new HyphenationTree(); hTree.loadSimplePatterns(stream); return hTree; } catch (Exception e) { return null; } }
/** * @param key * @return a hyphenation tree */ public static HyphenationTree getResourceHyphenationTree(String key) { try { InputStream stream = BaseFont.getResourceStream(defaultHyphLocation + key + ".xml"); if (stream == null && key.length() > 2) stream = BaseFont.getResourceStream(defaultHyphLocation + key.substring(0, 2) + ".xml"); if (stream == null) return null; HyphenationTree hTree = new HyphenationTree(); hTree.loadSimplePatterns(stream); return hTree; } catch (Exception e) { return null; } }