aboutsummaryrefslogtreecommitdiffstats
path: root/native/jni/src/suggest/core/dicnode
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-09-12 22:26:09 +0900
committerJean Chalard <jchalard@google.com>2014-09-19 13:44:42 +0900
commit6da9b21191dc7d6049d96945366ec7e605e716e6 (patch)
treeac8dcb925df7ead27b87faace0320f867cd0d6dd /native/jni/src/suggest/core/dicnode
parent63e483658fb993338db1259d44de8de848aae14b (diff)
downloadlatinime-6da9b21191dc7d6049d96945366ec7e605e716e6.tar.gz
latinime-6da9b21191dc7d6049d96945366ec7e605e716e6.tar.xz
latinime-6da9b21191dc7d6049d96945366ec7e605e716e6.zip
[ML8] Add a language weight
...and rename an improperly named normalization value Bug: 11230254 Change-Id: I0f5633148a9f66dbfd7d28540b8a8985131c4549
Diffstat (limited to 'native/jni/src/suggest/core/dicnode')
-rw-r--r--native/jni/src/suggest/core/dicnode/dic_node.h5
-rw-r--r--native/jni/src/suggest/core/dicnode/internal/dic_node_state_scoring.h6
2 files changed, 7 insertions, 4 deletions
diff --git a/native/jni/src/suggest/core/dicnode/dic_node.h b/native/jni/src/suggest/core/dicnode/dic_node.h
index ec61783cb..5214077dc 100644
--- a/native/jni/src/suggest/core/dicnode/dic_node.h
+++ b/native/jni/src/suggest/core/dicnode/dic_node.h
@@ -295,8 +295,9 @@ class DicNode {
}
// Used to prune nodes
- float getCompoundDistance(const float languageWeight) const {
- return mDicNodeState.mDicNodeStateScoring.getCompoundDistance(languageWeight);
+ float getCompoundDistance(const float weightOfLangModelVsSpatialModel) const {
+ return mDicNodeState.mDicNodeStateScoring.getCompoundDistance(
+ weightOfLangModelVsSpatialModel);
}
AK_FORCE_INLINE const int *getOutputWordBuf() const {
diff --git a/native/jni/src/suggest/core/dicnode/internal/dic_node_state_scoring.h b/native/jni/src/suggest/core/dicnode/internal/dic_node_state_scoring.h
index c19d48eb9..3a54c2599 100644
--- a/native/jni/src/suggest/core/dicnode/internal/dic_node_state_scoring.h
+++ b/native/jni/src/suggest/core/dicnode/internal/dic_node_state_scoring.h
@@ -103,8 +103,10 @@ class DicNodeStateScoring {
return getCompoundDistance(1.0f);
}
- float getCompoundDistance(const float languageWeight) const {
- return mSpatialDistance + mLanguageDistance * languageWeight;
+ float getCompoundDistance(
+ const float weightOfLangModelVsSpatialModel) const {
+ return mSpatialDistance
+ + mLanguageDistance * weightOfLangModelVsSpatialModel;
}
float getNormalizedCompoundDistance() const {