From d83e9c7e05622570b11d0e75817350aeb70bcd23 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sun, 19 Mar 2023 11:16:25 +0800 Subject: [PATCH] DataCompiler // Specify when to calculate NORM. --- DataCompiler/dataCompiler.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DataCompiler/dataCompiler.swift b/DataCompiler/dataCompiler.swift index 9fe7364a..9504c93d 100644 --- a/DataCompiler/dataCompiler.swift +++ b/DataCompiler/dataCompiler.swift @@ -426,7 +426,7 @@ func weightAndSort(_ arrStructUncalculated: [Unigram], isCHS: Bool) -> [Unigram] let fscale = 2.7 var norm = 0.0 for unigram in arrStructUncalculated { - if unigram.count >= 0 { + if (1 ... 6).contains(unigram.value.count), unigram.category != .custom { norm += fscale ** (Double(unigram.value.count) / 3.0 - 1.0) * Double(unigram.count) }