DataCompiler // Clean credits of formulas.
- 依《中華人民共和國著作權法》第五條,「公式」不適用該法。
This commit is contained in:
parent
a6c459cb7f
commit
ac54515265
|
@ -336,20 +336,19 @@ func weightAndSort(_ arrStructUncalculated: [Entry], isCHS: Bool) -> [Entry] {
|
|||
var norm: Float = 0.0
|
||||
for entry in arrStructUncalculated {
|
||||
if entry.valCount >= 0 {
|
||||
norm += fscale**(Float(entry.valPhrase.count) / 3.0 - 1.0) * Float(entry.valCount) // Credit: MJHsieh.
|
||||
norm += fscale**(Float(entry.valPhrase.count) / 3.0 - 1.0) * Float(entry.valCount)
|
||||
}
|
||||
}
|
||||
// norm 計算完畢,開始將 norm 作為新的固定常數來為每個詞條記錄計算權重。
|
||||
// 將新酷音的詞語出現次數數據轉換成小麥引擎可讀的數據形式。
|
||||
// 對出現次數小於 1 的詞條,將 0 當成 0.5 來處理、以防止除零。
|
||||
// 統計公式著作權歸 MJHsieh 所有(MIT License)。
|
||||
for entry in arrStructUncalculated {
|
||||
var weight: Float = 0
|
||||
switch entry.valCount {
|
||||
case -1: // 假名
|
||||
weight = -13
|
||||
case 0: // 墊底低頻漢字與詞語
|
||||
weight = log10(fscale**(Float(entry.valPhrase.count) / 3.0 - 1.0) * 0.5 / norm) // Credit: MJHsieh.
|
||||
weight = log10(fscale**(Float(entry.valPhrase.count) / 3.0 - 1.0) * 0.5 / norm)
|
||||
default:
|
||||
weight = log10(fscale**(Float(entry.valPhrase.count) / 3.0 - 1.0) * Float(entry.valCount) / norm) // Credit: MJHsieh.
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue