mirror of
https://github.com/laosb/ReadabilityFramework.git
synced 2025-04-30 12:41:08 +00:00
24 lines
471 B
Swift
24 lines
471 B
Swift
//
|
|
// ReadabilityScorer.swift
|
|
// Readability
|
|
//
|
|
// Created by Shibo Lyu on 2022/5/19.
|
|
//
|
|
|
|
import Foundation
|
|
import SwiftUI
|
|
|
|
struct RAScorerMeta {
|
|
let name: String
|
|
let creator: String
|
|
/** Should be in APA format. */
|
|
let citation: String
|
|
}
|
|
|
|
protocol RAScorer {
|
|
static var meta: RAScorerMeta { get }
|
|
static var requiresCommonMetrics: Set<RACommonMetric>? { get }
|
|
|
|
init()
|
|
func score(_ text: String, metrics: RACommonMetricsCalculator.Results?) -> Double
|
|
}
|