本文整理了Java中net.sf.extjwnl.data.Word.getUseCount()
方法的一些代码示例,展示了Word.getUseCount()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Word.getUseCount()
方法的具体详情如下:
包路径:net.sf.extjwnl.data.Word
类名称:Word
方法名:getUseCount
[英]Returns the number of times each tagged sense occurs in a semantic concordance.
[中]返回每个标记的意义在语义一致性中出现的次数。
代码示例来源:origin: net.sf.extjwnl/extjwnl
private static int getUseCount(Synset synset, String lemma) {
for (Word w : synset.getWords()) {
if (w.getLemma().equalsIgnoreCase(lemma)) {
if (0 < w.getUseCount()) {
return w.getUseCount();
}
}
}
return 0;
}
代码示例来源:origin: extjwnl/extjwnl
private static int getUseCount(Synset synset, String lemma) {
for (Word w : synset.getWords()) {
if (w.getLemma().equalsIgnoreCase(lemma)) {
if (0 < w.getUseCount()) {
return w.getUseCount();
}
}
}
return 0;
}
代码示例来源:origin: net.sf.extjwnl/extjwnl-utilities
private static boolean hasUseCount(final IndexWord iw) {
for (final Synset synset : iw.getSenses()) {
for (final Word word : synset.getWords()) {
if (0 < word.getUseCount()) {
return true;
}
}
}
return false;
}
代码示例来源:origin: extjwnl/extjwnl
private static boolean hasUseCount(final IndexWord iw) {
for (final Synset synset : iw.getSenses()) {
for (final Word word : synset.getWords()) {
if (0 < word.getUseCount()) {
return true;
}
}
}
return false;
}
代码示例来源:origin: hltfbk/Excitement-Open-Platform
ret.add(new WordAndUsage(word.getLemma(), word.getUseCount()));
代码示例来源:origin: net.sf.extjwnl/extjwnl
private ArrayList<Word> collectWordsToRender() throws JWNLException {
ArrayList<Word> result = new ArrayList<>();
Set<String> renderedKeys = new HashSet<>();
for (POS pos : POS.getAllPOS()) {
Iterator<IndexWord> ii = dictionary.getIndexWordIterator(pos);
while (ii.hasNext()) {
IndexWord iw = ii.next();
for (int i = 0; i < iw.getSenses().size(); i++) {
for (Word w : iw.getSenses().get(i).getWords()) {
if (0 < w.getUseCount()) {
String key = w.getSenseKeyWithAdjClass();
if (!renderedKeys.contains(key)) {
result.add(w);
renderedKeys.add(key);
}
}
}
}
}
}
return result;
}
代码示例来源:origin: extjwnl/extjwnl
private ArrayList<Word> collectWordsToRender() throws JWNLException {
ArrayList<Word> result = new ArrayList<>();
Set<String> renderedKeys = new HashSet<>();
for (POS pos : POS.getAllPOS()) {
Iterator<IndexWord> ii = dictionary.getIndexWordIterator(pos);
while (ii.hasNext()) {
IndexWord iw = ii.next();
for (int i = 0; i < iw.getSenses().size(); i++) {
for (Word w : iw.getSenses().get(i).getWords()) {
if (0 < w.getUseCount()) {
String key = w.getSenseKeyWithAdjClass();
if (!renderedKeys.contains(key)) {
result.add(w);
renderedKeys.add(key);
}
}
}
}
}
}
return result;
}
代码示例来源:origin: extjwnl/extjwnl
private static void printOverview(final POS pos, final IndexWord iw, final boolean needGloss,
final boolean needLex, final boolean needOffset,
final boolean needSenseNum, final boolean needSenseKeys) throws JWNLException {
System.out.println("\nOverview of " + pos.getLabel() + " " + iw.getLemma());
System.out.println("\nThe " + pos.getLabel() + " " + iw.getLemma() + " has " + iw.getSenses().size() + " senses");
for (int i = 0; i < iw.getSenses().size(); i++) {
final Synset synset = iw.getSenses().get(i);
System.out.print((i + 1) + ". ");
final int widx = synset.indexOfWord(iw.getLemma());
if (-1 < widx) {
final Word word = synset.getWords().get(widx);
if (0 < word.getUseCount()) {
System.out.print("(" + word.getUseCount() + ") ");
}
}
printSense("", synset, needGloss, needLex, needOffset, needSenseNum, needSenseKeys);
}
}
代码示例来源:origin: net.sf.extjwnl/extjwnl-utilities
private static void printOverview(final POS pos, final IndexWord iw, final boolean needGloss,
final boolean needLex, final boolean needOffset,
final boolean needSenseNum, final boolean needSenseKeys) throws JWNLException {
System.out.println("\nOverview of " + pos.getLabel() + " " + iw.getLemma());
System.out.println("\nThe " + pos.getLabel() + " " + iw.getLemma() + " has " + iw.getSenses().size() + " senses");
for (int i = 0; i < iw.getSenses().size(); i++) {
final Synset synset = iw.getSenses().get(i);
System.out.print((i + 1) + ". ");
final int widx = synset.indexOfWord(iw.getLemma());
if (-1 < widx) {
final Word word = synset.getWords().get(widx);
if (0 < word.getUseCount()) {
System.out.print("(" + word.getUseCount() + ") ");
}
}
printSense("", synset, needGloss, needLex, needOffset, needSenseNum, needSenseKeys);
}
}
代码示例来源:origin: de.tudarmstadt.ukp.dkpro.wsd/de.tudarmstadt.ukp.dkpro.wsd.si.wordnet
public CachedSense(String senseId)
throws SenseInventoryException
{
super(senseId);
synset = stringToSynset.transform(id);
pos = wordNetPosToSiPos.transform(synset.getPOS());
useCount = 0;
for (Word word : synset.getWords()) {
useCount += word.getUseCount();
}
}
代码示例来源:origin: net.sf.extjwnl/extjwnl-utilities
synsetWordStmt.setInt(5, word.getUseCount());
synsetWordStmt.setLong(6, word.getLexId());
代码示例来源:origin: extjwnl/extjwnl
synsetWordStmt.setInt(5, word.getUseCount());
synsetWordStmt.setLong(6, word.getLexId());
代码示例来源:origin: de.tudarmstadt.ukp.dkpro.wsd/de.tudarmstadt.ukp.dkpro.wsd.si.wordnet
public CachedSense(String senseId)
throws SenseInventoryException
{
super(senseId);
try {
word = wn.getWordBySenseKey(senseId);
synset = word.getSynset();
pos = wordNetPosToSiPos.transform(word.getPOS());
useCount = word.getUseCount();
}
catch (JWNLException e) {
throw new SenseInventoryException(e);
}
}
代码示例来源:origin: net.sf.extjwnl/extjwnl
append(' ').append(word.getUseCount());
int result = o2.getUseCount() - o1.getUseCount();
if (0 == result) {
try {
s.append(word.getUseCount()).
append(' ').append(word.getSenseKeyWithAdjClass()).
append(' ').append(word.getSenseNumber());
result.append(i + 1);
result.append(" ");
result.append(w.getUseCount());
senseIndexContent.add(result.toString());
代码示例来源:origin: extjwnl/extjwnl
append(' ').append(word.getUseCount());
int result = o2.getUseCount() - o1.getUseCount();
if (0 == result) {
try {
s.append(word.getUseCount()).
append(' ').append(word.getSenseKeyWithAdjClass()).
append(' ').append(word.getSenseNumber());
result.append(i + 1);
result.append(" ");
result.append(w.getUseCount());
senseIndexContent.add(result.toString());
内容来源于网络,如有侵权,请联系作者删除!