DataCompiler // Clean credits of formulas.

- 依《中華人民共和國著作權法》第五條,「公式」不適用該法。
This commit is contained in:
ShikiSuen 2022-03-07 10:12:20 +08:00
parent 641c0ea821
commit 95ba7ae5c5
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 var norm: Float = 0.0
for entry in arrStructUncalculated { for entry in arrStructUncalculated {
if entry.valCount >= 0 { 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 // norm norm
// //
// 1 0 0.5 // 1 0 0.5
// MJHsieh MIT License
for entry in arrStructUncalculated { for entry in arrStructUncalculated {
var weight: Float = 0 var weight: Float = 0
switch entry.valCount { switch entry.valCount {
case -1: // case -1: //
weight = -13 weight = -13
case 0: // 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: default:
weight = log10(fscale**(Float(entry.valPhrase.count) / 3.0 - 1.0) * Float(entry.valCount) / norm) // Credit: MJHsieh. weight = log10(fscale**(Float(entry.valPhrase.count) / 3.0 - 1.0) * Float(entry.valCount) / norm) // Credit: MJHsieh.
} }