feat: add SstData with DictionaryFile and word knowledge

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 15:06:55 +02:00
co-authored by Claude Sonnet 5.5
parent af1acdc0fa
commit a5fa0686f0
6 changed files with 273 additions and 0 deletions
@@ -0,0 +1,24 @@
import Testing
@testable import SstData
struct SystemWordKnowledgeTests {
let knowledge = SystemWordKnowledge()
@Test func recognisesEnglishAndDutchWords() {
#expect(knowledge.isWord("cloud"))
#expect(knowledge.isWord("Cloud"))
#expect(knowledge.isWord("vandaag"))
}
@Test func doesNotTreatProductNamesAsWords() {
#expect(!knowledge.isWord("vercel"))
#expect(!knowledge.isWord("supabase"))
#expect(!knowledge.isWord("anthropic"))
}
@Test func functionWordsComeFromTheBuiltInList() {
#expect(knowledge.isFunctionWord("de"))
#expect(knowledge.isFunctionWord("The"))
#expect(!knowledge.isFunctionWord("vercel"))
}
}