当前位置: 首页>>代码示例>>Java>>正文


Java POS.getAllPOS方法代码示例

本文整理汇总了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();
}
 
开发者ID:extjwnl,项目名称:extjwnl,代码行数:24,代码来源:DictionaryToMap.java

示例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;
}
 
开发者ID:pschuette22,项目名称:Zeppa-AppEngine,代码行数:18,代码来源:QueryHelper.java

示例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);
        }
    }
}
 
开发者ID:extjwnl,项目名称:extjwnl,代码行数:35,代码来源:MapBackedDictionary.java

示例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;
}
 
开发者ID:extjwnl,项目名称:extjwnl,代码行数:8,代码来源:CacheSet.java

示例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;
}
 
开发者ID:extjwnl,项目名称:extjwnl,代码行数:8,代码来源:CacheSet.java

示例6: clearCache

import net.sf.extjwnl.data.POS; //导入方法依赖的package包/类
public void clearCache(K key) {
    for (POS pos : POS.getAllPOS()) {
        getCache(key).getCache(pos).clear();
    }
}
 
开发者ID:extjwnl,项目名称:extjwnl,代码行数:6,代码来源:CacheSet.java

示例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);
    }
}
 
开发者ID:extjwnl,项目名称:extjwnl,代码行数:6,代码来源:CacheSet.java

示例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));
    }
}
 
开发者ID:extjwnl,项目名称:extjwnl,代码行数:7,代码来源:LRUPOSCache.java


注:本文中的net.sf.extjwnl.data.POS.getAllPOS方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。