fix: Public , public, public!

This commit is contained in:
Shibo Lyu 2022-05-20 13:21:47 +08:00
parent 4343848549
commit 3a5ec5de50
2 changed files with 8 additions and 4 deletions

View file

@ -9,10 +9,10 @@ import Foundation
import SwiftUI import SwiftUI
public struct RAScorerMeta { public struct RAScorerMeta {
let name: String public let name: String
let creator: String public let creator: String
/** Should be in APA format. */ /** Should be in APA format. */
let citation: String public let citation: String
} }
public protocol RAScorer { public protocol RAScorer {

View file

@ -20,7 +20,7 @@ public class RAScoringTask {
.fleschKincaidGrade: RAFleschKincaidGradeScorer.self .fleschKincaidGrade: RAFleschKincaidGradeScorer.self
] ]
public var scorersToRun: Set<Scorer> = Set(Scorer.allCases) public var scorersToRun: Set<Scorer>
/** Derived from `scorersToRun`. */ /** Derived from `scorersToRun`. */
public var scorers: [Scorer: RAScorer.Type] { public var scorers: [Scorer: RAScorer.Type] {
@ -41,6 +41,10 @@ public class RAScoringTask {
} }
} }
public init(scorers: Set<Scorer> = Set(Scorer.allCases)) {
self.scorersToRun = scorers
}
public func run(on text: String) -> Results { public func run(on text: String) -> Results {
var commonMetrics: RACommonMetricsCalculator.Results? = nil var commonMetrics: RACommonMetricsCalculator.Results? = nil