This commit is contained in:
28
docs/snippets/swift/config/config_programmatic.md
Normal file
28
docs/snippets/swift/config/config_programmatic.md
Normal file
@@ -0,0 +1,28 @@
|
||||
```swift title="Swift"
|
||||
import Foundation
|
||||
import Kreuzberg
|
||||
import RustBridge
|
||||
|
||||
let configJson = """
|
||||
{
|
||||
"use_cache": true,
|
||||
"enable_quality_processing": true,
|
||||
"ocr": {
|
||||
"backend": "tesseract",
|
||||
"language": "eng+deu",
|
||||
"tesseract_config": {
|
||||
"psm": 6
|
||||
}
|
||||
},
|
||||
"chunking": {
|
||||
"max_characters": 1000,
|
||||
"overlap": 200
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
let config = try extractionConfigFromJson(configJson)
|
||||
let result = try extractFileSync("document.pdf", nil, config)
|
||||
|
||||
print("Content length: \(result.content().toString().count)")
|
||||
```
|
||||
Reference in New Issue
Block a user