T - 这是储存器map中key的类型,具有相同key的句子会存入同一个entrypublic abstract class BaseScorer<T extends ISentenceKey> extends Object implements IScorer
| Modifier and Type | Field and Description |
|---|---|
double |
boost
权重
|
protected Map<T,Set<String>> |
storage
储存
|
| Constructor and Description |
|---|
BaseScorer() |
| Modifier and Type | Method and Description |
|---|---|
void |
addSentence(String sentence)
输入一个候选句子
|
Map<String,Double> |
computeScore(String outerSentence)
计算分值
|
protected abstract T |
generateKey(String sentence)
生成能够代表这个句子的键
|
void |
removeAllSentences()
清空该推荐器中的所有句子
|
BaseScorer |
setBoost(double boost)
设置权重
|
protected Map<T extends ISentenceKey,Set<String>> storage
public double boost
public BaseScorer setBoost(double boost)
boost - public void addSentence(String sentence)
IScoreraddSentence in interface IScorerprotected abstract T generateKey(String sentence)
sentence - public Map<String,Double> computeScore(String outerSentence)
IScorercomputeScore in interface IScorerouterSentence - 外部句子public void removeAllSentences()
IScorerremoveAllSentences in interface IScorerCopyright © 2014–2021 码农场. All rights reserved.