/** * @param lang * @param country * @return the hyphenation tree */ public static HyphenationTree getHyphenationTree(String lang, String country) { String key = lang; // check whether the country code has been used if (country != null && !country.equals("none")) { key += "_" + country; } // first try to find it in the cache if (hyphenTrees.containsKey(key)) { return (HyphenationTree)hyphenTrees.get(key); } if (hyphenTrees.containsKey(lang)) { return (HyphenationTree)hyphenTrees.get(lang); } HyphenationTree hTree = getResourceHyphenationTree(key); if (hTree == null) hTree = getFileHyphenationTree(key); // put it into the pattern cache if (hTree != null) { hyphenTrees.put(key, hTree); } return hTree; }
/** * @param lang * @param country * @return the hyphenation tree */ public static HyphenationTree getHyphenationTree(String lang, String country) { String key = lang; // check whether the country code has been used if (country != null && !country.equals("none")) { key += "_" + country; } // first try to find it in the cache if (hyphenTrees.containsKey(key)) { return (HyphenationTree)hyphenTrees.get(key); } if (hyphenTrees.containsKey(lang)) { return (HyphenationTree)hyphenTrees.get(lang); } HyphenationTree hTree = getResourceHyphenationTree(key); if (hTree == null) hTree = getFileHyphenationTree(key); // put it into the pattern cache if (hTree != null) { hyphenTrees.put(key, hTree); } return hTree; }
/** * @param lang * @param country * @return the hyphenation tree */ public static HyphenationTree getHyphenationTree(String lang, String country) { String key = lang; // check whether the country code has been used if (country != null && !country.equals("none")) { key += "_" + country; } // first try to find it in the cache if (hyphenTrees.containsKey(key)) { return (HyphenationTree)hyphenTrees.get(key); } if (hyphenTrees.containsKey(lang)) { return (HyphenationTree)hyphenTrees.get(lang); } HyphenationTree hTree = getResourceHyphenationTree(key); if (hTree == null) hTree = getFileHyphenationTree(key); // put it into the pattern cache if (hTree != null) { hyphenTrees.put(key, hTree); } return hTree; }