mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-24 04:03:03 -04:00
Fix: default search parameter
This commit is contained in:
parent
ca128c6f0c
commit
424c3e208d
@ -99,8 +99,21 @@ class SearchTuneController: UIViewController, UITableViewDataSource {
|
||||
|
||||
class WeightFactor {
|
||||
class func calculate(prob: Double) -> Double {
|
||||
if UIApplication.buildStatus == .Alpha {
|
||||
if let m = Defaults[.m], let n = Defaults[.n] {
|
||||
return caluclateLog(m: m, n: n, prob: prob)
|
||||
} else {
|
||||
return 1
|
||||
}
|
||||
} else {
|
||||
let m = 6.4524436415334163
|
||||
let n = 7.5576145596090623
|
||||
return caluclateLog(m: m, n: n, prob: prob)
|
||||
}
|
||||
}
|
||||
|
||||
private class func caluclateLog(m m: Double, n: Double, prob: Double) -> Double {
|
||||
let e = 2.718281828459
|
||||
guard let m = Defaults[.m], let n = Defaults[.n] else {return 1}
|
||||
return log(n - m * prob) / log(e)
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1558</string>
|
||||
<string>1570</string>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
|
@ -42,7 +42,7 @@ enum BuildStatus {
|
||||
extension UIApplication {
|
||||
class var buildStatus: BuildStatus {
|
||||
get {
|
||||
return .Beta
|
||||
return .Release
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user