feat: add SstData with DictionaryFile and word knowledge
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import Foundation
|
||||
@testable import SstData
|
||||
|
||||
/// Deterministic stand-in for the macOS spell checker.
|
||||
struct FakeKnowledge: WordKnowledge {
|
||||
var words: Set<String> = ["cloud", "code", "some", "thing", "something", "reef", "slack", "in", "de", "the", "of"]
|
||||
var functionWords: Set<String> = ["in", "de", "the", "of"]
|
||||
func isWord(_ word: String) -> Bool { words.contains(word.lowercased()) }
|
||||
func isFunctionWord(_ word: String) -> Bool { functionWords.contains(word.lowercased()) }
|
||||
}
|
||||
|
||||
func term(_ text: String) -> DictionaryEntry { DictionaryEntry(kind: .term(text)) }
|
||||
func pair(_ heard: String, _ wrote: String) -> DictionaryEntry { DictionaryEntry(kind: .correction(heard: heard, wrote: wrote)) }
|
||||
Reference in New Issue
Block a user