We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d230fb4 commit 40c60f3Copy full SHA for 40c60f3
src/main/java/com/hankcs/hanlp/dictionary/TransformMatrixDictionary.java
@@ -114,13 +114,18 @@ public boolean load(String path)
114
total[j] = 0;
115
for (int i = 0; i < ordinaryMax; ++i)
116
{
117
- total[j] += matrix[i][j];
118
- total[j] += matrix[j][i];
+ total[j] += matrix[j][i]; // 按行累加
119
}
120
121
for (int j = 0; j < ordinaryMax; ++j)
122
123
- total[j] -= matrix[j][j];
+ if (total[j] == 0)
+ {
124
+ for (int i = 0; i < ordinaryMax; ++i)
125
126
+ total[j] += matrix[i][j]; // 按列累加
127
+ }
128
129
130
131
0 commit comments