This commit is contained in:
13
docs/snippets/r/config/language_detection_config.md
Normal file
13
docs/snippets/r/config/language_detection_config.md
Normal file
@@ -0,0 +1,13 @@
|
||||
```r title="R"
|
||||
library(kreuzberg)
|
||||
|
||||
config <- list(
|
||||
language_detection = list(enabled = TRUE)
|
||||
)
|
||||
|
||||
json <- extract_file_sync("document.pdf", "application/pdf", config)
|
||||
result <- jsonlite::fromJSON(json, simplifyVector = FALSE)
|
||||
|
||||
cat(sprintf("Detected language: %s\n", result$detected_language))
|
||||
cat(sprintf("Content preview: %.60s...\n", result$content))
|
||||
```
|
||||
Reference in New Issue
Block a user