本文整理汇总了Java中net.sf.extjwnl.data.POS.getAllPOS方法的典型用法代码示例。如果您正苦于以下问题:Java POS.getAllPOS方法的具体用法?Java POS.getAllPOS怎么用?Java POS.getAllPOS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.extjwnl.data.POS
的用法示例。
在下文中一共展示了POS.getAllPOS方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convert
import net.sf.extjwnl.data.POS; //导入方法依赖的package包/类
/**
* Converts the current Dictionary to a MapBackedDictionary.
*
* @throws JWNLException JWNLException
* @throws IOException IOException
*/
public void convert() throws JWNLException, IOException {
destinationFiles.open();
destinationFiles.edit();
boolean canClearCache = (dictionary instanceof AbstractCachingDictionary) && ((AbstractCachingDictionary) dictionary).isCachingEnabled();
for (DictionaryFileType fileType : DictionaryFileType.getAllDictionaryFileTypes()) {
for (POS pos : POS.getAllPOS()) {
System.out.println("Converting " + pos.getLabel() + " " + fileType.getName() + "...");
serialize(pos, fileType);
}
if (canClearCache) {
((AbstractCachingDictionary) dictionary).clearCache(fileType.getElementType());
}
}
destinationFiles.close();
}
示例2: getApplicablePOS
import net.sf.extjwnl.data.POS; //导入方法依赖的package包/类
/**
* Get a list of applicable parts of speech for a PointerType
*
* @param pt
* - some PointerType
* @return a List of POS
*/
private static List<POS> getApplicablePOS(PointerType pt) {
List<POS> validPOS = new ArrayList<POS>();
for (POS pos : POS.getAllPOS()) {
if (pt.appliesTo(pos)) {
validPOS.add(pos);
}
}
return validPOS;
}
示例3: load
import net.sf.extjwnl.data.POS; //导入方法依赖的package包/类
private void load() throws JWNLException {
// because restore variable is static
synchronized (Dictionary.class) {
Dictionary.setRestoreDictionary(this);
try {
if (!files.isOpen()) {
files.open();
}
// load all the hash tables into memory
if (log.isDebugEnabled()) {
log.debug(getMessages().resolveMessage("DICTIONARY_INFO_009"));
}
if (log.isTraceEnabled()) {
log.trace(getMessages().resolveMessage("DICTIONARY_INFO_010", Runtime.getRuntime().freeMemory()));
}
for (DictionaryFileType fileType : DictionaryFileType.getAllDictionaryFileTypes()) {
DictionaryCatalog<ObjectDictionaryFile> catalog = files.get(fileType);
for (POS pos : POS.getAllPOS()) {
if (log.isDebugEnabled()) {
log.debug(getMessages().resolveMessage("DICTIONARY_INFO_011", new Object[]{pos.getLabel(), fileType.getName()}));
}
putTable(pos, fileType, loadDictFile(catalog.get(pos)));
if (log.isTraceEnabled()) {
log.trace(getMessages().resolveMessage("DICTIONARY_INFO_012", Runtime.getRuntime().freeMemory()));
}
}
}
files.close();
} finally {
Dictionary.setRestoreDictionary(null);
}
}
}
示例4: getCacheSize
import net.sf.extjwnl.data.POS; //导入方法依赖的package包/类
public int getCacheSize(K cacheKey) {
int result = 0;
for (POS pos : POS.getAllPOS()) {
result = result + getCache(cacheKey).getCache(pos).size();
}
return result;
}
示例5: getCacheCapacity
import net.sf.extjwnl.data.POS; //导入方法依赖的package包/类
public long getCacheCapacity(K cacheKey) {
long result = 0;
for (POS pos : POS.getAllPOS()) {
result = result + getCache(cacheKey).getCache(pos).getCapacity();
}
return result;
}
示例6: clearCache
import net.sf.extjwnl.data.POS; //导入方法依赖的package包/类
public void clearCache(K key) {
for (POS pos : POS.getAllPOS()) {
getCache(key).getCache(pos).clear();
}
}
示例7: setCacheCapacity
import net.sf.extjwnl.data.POS; //导入方法依赖的package包/类
public void setCacheCapacity(K cacheKey, int capacity) {
for (POS pos : POS.getAllPOS()) {
getCache(cacheKey).getCache(pos).setCapacity(capacity);
}
}
示例8: LRUPOSCache
import net.sf.extjwnl.data.POS; //导入方法依赖的package包/类
public LRUPOSCache(int capacity) {
caches = new EnumMap<POS, Cache<K, V>>(POS.class);
for (POS pos : POS.getAllPOS()) {
caches.put(pos, new LRUCache<K, V>(capacity));
}
}