本文整理了Java中net.sf.extjwnl.data.Word.getSenseKey()
方法的一些代码示例,展示了Word.getSenseKey()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Word.getSenseKey()
方法的具体详情如下:
包路径:net.sf.extjwnl.data.Word
类名称:Word
方法名:getSenseKey
[英]Returns the sense key of a lemma.
[中]返回引理的意义键。
代码示例来源:origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.integration.wordnet-gpl
@Override
public int compare(Word o1, Word o2) {
return o1.getSenseKey().compareTo(o2.getSenseKey());
}
});
代码示例来源:origin: extjwnl/extjwnl
result.append(w.getSenseKey()).append(" ");
formatOffset(synset.getOffset(), offsetLength, result);
result.append(" ");
代码示例来源:origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.integration.wordnet-gpl
@Override
public int compare(Word o1, Word o2) {
return o1.getSenseKey().compareTo(o2.getSenseKey());
}
});
代码示例来源:origin: net.sf.extjwnl/extjwnl
result.append(w.getSenseKey()).append(" ");
formatOffset(synset.getOffset(), offsetLength, result);
result.append(" ");
代码示例来源:origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.integration.wordnet-gpl
@Override
public int compare(Word o1, Word o2) {
return o1.getSenseKey().compareTo(o2.getSenseKey());
}
});
代码示例来源:origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.integration.wordnet-gpl
/**
* This method consumes a WordNet's lexeme and returns a list of lexeme's example-sentences, extracted by this generator<br>
* from lexeme's synset.
* @param lexeme a WordNet's lexeme which example sentences should be returned
* @return lexeme's example sentences extracted by this generator
* @see Word
* @see net.sf.extjwnl.data.Synset
*/
public List<String> getExamples(Word lexeme){
return examples.get(lexeme.getSenseKey());
}
代码示例来源:origin: net.sf.extjwnl/extjwnl-utilities
System.out.print(" [" + word.getSenseKey() + "]");
代码示例来源:origin: net.sf.extjwnl/extjwnl
for (final Synset synset : iw.getSenses()) {
for (final Word word : synset.getWords()) {
if (senseKey.equals(word.getSenseKey())) {
result = word;
break searchB;
代码示例来源:origin: extjwnl/extjwnl
System.out.print(" [" + word.getSenseKey() + "]");
代码示例来源:origin: extjwnl/extjwnl
for (final Synset synset : iw.getSenses()) {
for (final Word word : synset.getWords()) {
if (senseKey.equals(word.getSenseKey())) {
result = word;
break searchB;
代码示例来源:origin: de.tudarmstadt.ukp.dkpro.wsd/de.tudarmstadt.ukp.dkpro.wsd.si.wordnet
for (Word w : s.getWords()) {
if (w.getLemma().equalsIgnoreCase(indexWord.getLemma())) {
senses.add(w.getSenseKey());
代码示例来源:origin: de.tudarmstadt.ukp.dkpro.wsd/de.tudarmstadt.ukp.dkpro.wsd.si.wordnet
PointerTarget t = p.getTarget();
if (t instanceof Word) {
neighbours.add(((Word) t).getSenseKey());
if (t instanceof Synset) {
for (Word w : ((Synset) t).getWords()) {
neighbours.add(w.getSenseKey());
代码示例来源:origin: apache/opennlp-sandbox
public static String[] getMostFrequentSenses(WSDSample sample) {
List<Synset> synsets = sample.getSynsets();
String[] senseKeys = new String[synsets.size()];
for (int i = 0; i < synsets.size(); i++) {
for (Word wd : synsets.get(i).getWords()) {
if (wd.getLemma().equalsIgnoreCase(
(sample.getLemmas()[sample.getTargetPosition()]))) {
try {
senseKeys[i] = WSDParameters.SenseSource.WORDNET.name() + " "
+ wd.getSenseKey();
break;
} catch (JWNLException e) {
e.printStackTrace();
}
break;
}
}
}
return senseKeys;
}
代码示例来源:origin: apache/opennlp-sandbox
if (wd.getLemma().equals(word)) {
try {
sense = sense + " " + wd.getSenseKey();
break;
} catch (JWNLException e) {
代码示例来源:origin: apache/opennlp-sandbox
public static String getMostFrequentSense(WSDSample sample) {
List<Synset> synsets = sample.getSynsets();
for (Word wd : synsets.get(0).getWords()) {
if (wd.getLemma()
.equalsIgnoreCase((sample.getLemmas()[sample.getTargetPosition()]))) {
try {
return WSDParameters.SenseSource.WORDNET.name() + " "
+ wd.getSenseKey();
} catch (JWNLException e) {
e.printStackTrace();
}
}
}
return "nonesense";
}
代码示例来源:origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.integration.wordnet-gpl
sense.setLexicalEntry(lexicalEntry);
String senseNumber = isr.getSenseNumber(lexeme.getSenseKey());
if(senseNumber != null){
int index = Integer.parseInt(senseNumber);
StringBuffer sb = new StringBuffer(128);
sb.append("IndexSenseReader did not provide sense number for senseKey ");
sb.append(lexeme.getSenseKey()).append('\n');
sb.append("adding a dummy value of sense number");
logger.warn(sb.toString());
sb.append(lexeme.getSynset().getPOS());
sb.append(" ");
sb.append(lexeme.getSenseKey());
monolingualExternalRef.setExternalSystem("WordNet 3.0 part of speech and sense key");
monolingualExternalRef.setExternalReference(sb.toString());
代码示例来源:origin: de.tudarmstadt.ukp.dkpro.wsd/de.tudarmstadt.ukp.dkpro.wsd.si.wordnet
if (t instanceof Word) {
pointerCount++;
targetSenseKeys.add(((Word) t).getSenseKey());
for (Word targetWord : ((Synset) t).getWords()) {
targetSenseKeys.add(targetWord
.getSenseKey());
undirectedWNGraph.addVertex(w.getSenseKey());
for (String targetSenseKey : targetSenseKeys) {
UnorderedPair<String> e = new UnorderedPair<String>(
w.getSenseKey(), targetSenseKey);
if (!undirectedWNGraph.containsEdge(e)) {
undirectedWNGraph.addEdge(e, w.getSenseKey(),
targetSenseKey);
代码示例来源:origin: de.tudarmstadt.ukp.dkpro.wsd/de.tudarmstadt.ukp.dkpro.wsd.si.wordnet
if (w.getLemma().equals(lemma)) {
try {
return w.getSenseKey();
代码示例来源:origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.integration.wordnet-gpl
List<ExampleMapping> mappings = new ArrayList<ExampleMapping>();
for (Word word : wnSynset.getWords())
mappings.add(new ExampleMapping(word.getSenseKey(), cleanText(word.getLemma())));
annotationList.add(wnSynset.getOffset() + wnSynset.getPOS().getKey() + "\t" + senseExample);
for (Word word : wnSynset.getWords())
annotationList.add("\t\t" + word.getSenseKey() + "\t" + word.getLemma());
annotationList.add("");
代码示例来源:origin: apache/opennlp-sandbox
.equals(sample.getLemmas()[sample.getTargetPosition()])) {
try {
senseKey = synWord.getSenseKey();
} catch (JWNLException e) {
e.printStackTrace();
内容来源于网络,如有侵权,请联系作者删除!