更新阅读器功能与示例

This commit is contained in:
shen
2026-07-27 21:43:13 +08:00
parent 68d9363f0a
commit 9392027106
78 changed files with 8780 additions and 2084 deletions
+38
View File
@@ -0,0 +1,38 @@
# RDAIReaderView
`RDAIReaderView` is the local indexing and retrieval foundation for ReadViewSDK AI reader features. Version `0.1` provides Natural Language sentence chunking, language detection, named-entity candidates, source-backed citations and local lexical retrieval. It does not upload book content.
## Install
```ruby
pod 'RDAIReaderView/NaturalLanguage'
pod 'RDPDFReaderView/AI'
pod 'RDEpubReaderView/AI'
```
## Use with PDF
```swift
let service = reader.makeAIReaderService()
try await service.prepareIndex(
options: RDAIIndexOptions(scope: .wholeDocument)
)
let matches = await service.retrieve(
query: "主角为什么离开",
options: RDAIRetrievalOptions(scope: .wholeDocument)
)
if let match = matches.first {
let citation = RDAICitation(
passageIdentifier: match.passage.id,
quote: match.passage.text,
locator: match.passage.locator
)
try await reader.makeAIContentProvider().aiShowCitationHighlight(citation)
}
```
PDF citations retain native-text versus OCR provenance. EPUB citations use normalized `href` and derive CFI ranges when navigating.
Foundation Models generation, persistent SQLite storage and the AI UI are planned follow-up modules; the Core API is intentionally independent of those capabilities.