DataCompiler // Clean credits of formulas.

- 依《中華人民共和國著作權法》第五條,「公式」不適用該法。
This commit is contained in:
ShikiSuen 2022-03-07 10:12:20 +08:00
parent a6c459cb7f
commit ac54515265
1 changed files with 2 additions and 3 deletions

View File

@ -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.
}