本文整理了Java中net.sf.extjwnl.data.Word.<init>()
方法的一些代码示例,展示了Word.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Word.<init>()
方法的具体详情如下:
包路径:net.sf.extjwnl.data.Word
类名称:Word
方法名:<init>
[英]Constructs a word tied to a synset, it's position within the synset, and the lemma.
[中]构造一个与语法集相关的单词,它在语法集中的位置,以及引理。
代码示例来源:origin: extjwnl/extjwnl
/**
* Creates a word.
*
* @param synset synset
* @param lemma lemma
* @return word
*/
protected Word createWord(Synset synset, String lemma) {
if (POS.VERB == synset.getPOS()) {
return new Verb(dictionary, synset, stringCache.replace(lemma), new BitSet());
} else if (POS.ADJECTIVE == synset.getPOS()) {
AdjectivePosition adjectivePosition = AdjectivePosition.NONE;
if (lemma.charAt(lemma.length() - 1) == ')') {
int left = lemma.indexOf('(');
if (left > 0) {
String marker = lemma
.substring(left + 1, lemma.length() - 1);
adjectivePosition = AdjectivePosition
.getAdjectivePositionForKey(marker);
lemma = lemma.substring(0, left);
}
}
return new Adjective(dictionary, synset, stringCache.replace(lemma), adjectivePosition);
} else {
return new Word(dictionary, synset, stringCache.replace(lemma));
}
}
代码示例来源:origin: net.sf.extjwnl/extjwnl
/**
* Creates a word.
*
* @param synset synset
* @param lemma lemma
* @return word
*/
protected Word createWord(Synset synset, String lemma) {
if (POS.VERB == synset.getPOS()) {
return new Verb(dictionary, synset, stringCache.replace(lemma), new BitSet());
} else if (POS.ADJECTIVE == synset.getPOS()) {
AdjectivePosition adjectivePosition = AdjectivePosition.NONE;
if (lemma.charAt(lemma.length() - 1) == ')') {
int left = lemma.indexOf('(');
if (left > 0) {
String marker = lemma
.substring(left + 1, lemma.length() - 1);
adjectivePosition = AdjectivePosition
.getAdjectivePositionForKey(marker);
lemma = lemma.substring(0, left);
}
}
return new Adjective(dictionary, synset, stringCache.replace(lemma), adjectivePosition);
} else {
return new Word(dictionary, synset, stringCache.replace(lemma));
}
}
代码示例来源:origin: extjwnl/extjwnl
private void addWord(Synset synset, String lemma) {
if (null != synset.getDictionary() && synset.getDictionary().isEditable()) {
if (!synset.containsWord(lemma)) {
synset.getWords().add(new Word(synset.getDictionary(), synset, lemma));
}
}
}
代码示例来源:origin: net.sf.extjwnl/extjwnl
private void addWord(Synset synset, String lemma) {
if (null != synset.getDictionary() && synset.getDictionary().isEditable()) {
if (!synset.containsWord(lemma)) {
synset.getWords().add(new Word(synset.getDictionary(), synset, lemma));
}
}
}
代码示例来源:origin: net.sf.extjwnl/extjwnl-utilities
final Synset tempSynset = d.createSynset(pos);
log.info("Creating word {}...", lemma);
workWord = new Word(d, tempSynset, lemma);
workWord.setLexId(lexId);
tempSynset.getWords().add(workWord);
final Word tempWord = new Word(d, workWord.getSynset(), args[i].replace('_', ' '));
workWord.getSynset().getWords().add(tempWord);
key = null;
代码示例来源:origin: extjwnl/extjwnl
final Synset tempSynset = d.createSynset(pos);
log.info("Creating word {}...", lemma);
workWord = new Word(d, tempSynset, lemma);
workWord.setLexId(lexId);
tempSynset.getWords().add(workWord);
final Word tempWord = new Word(d, workWord.getSynset(), args[i].replace('_', ' '));
workWord.getSynset().getWords().add(tempWord);
key = null;
内容来源于网络,如有侵权,请联系作者删除!