/** * 忽略的单字 * * @return */ public Dictionary getXwords() { if (xwords == null) { synchronized (this) { if (xwords == null) { xwords = new BinaryDictionary(wordsLoader.loadCJKXwords().toArray(new String[0])); } } } return xwords; }
/** * 计量单位 * * @return */ public Dictionary getUnits() { if (units == null) { synchronized (this) { if (units == null) { units = new HashBinaryDictionary( wordsLoader.loadCJKUnit().toArray(new String[0]), 1024, 0.75f); } } } return units; }
/** * 忽略的词语 * * @return */ public Dictionary getXchars() { if (xchars == null) { synchronized (this) { if (xchars == null) { xchars = new HashBinaryDictionary( wordsLoader.loadCJKXchars().toArray(new String[0]), 256, 0.75f); } } } return xchars; }
/** * 姓氏字典 * * @return */ public Dictionary getConfucianFamilyNames() { if (confucianFamilyNames == null) { synchronized (this) { if (confucianFamilyNames == null) { confucianFamilyNames = new BinaryDictionary( wordsLoader.loadCJKConfucianFamilyNames().toArray(new String[0])); } } } return confucianFamilyNames; }
/** * 词汇表字典 * * @return */ public Dictionary getVocabulary() { if (vocabulary == null) { synchronized (this) { if (vocabulary == null) { // 大概有5639个字有词语,故取0x2fff=x^13>8000>8000*0.75=6000>5639 vocabulary = new HashBinaryDictionary( wordsLoader.loadCJKVocabulary().toArray(new String[0]), 0x2fff, 0.75f); } } } return vocabulary; }