21 lines
581 B
Markdown
21 lines
581 B
Markdown
```kotlin title="Kotlin"
|
|
import dev.kreuzberg.*
|
|
import java.nio.file.Paths
|
|
import java.util.Optional
|
|
|
|
fun main() {
|
|
val languageDetection = LanguageDetectionConfig.builder()
|
|
.withEnabled(true)
|
|
.withMinConfidence(0.8)
|
|
.withDetectMultiple(true)
|
|
.build()
|
|
|
|
val config = ExtractionConfig.builder()
|
|
.withLanguageDetection(Optional.of(languageDetection))
|
|
.build()
|
|
|
|
val result = Kreuzberg.extractFileSync(Paths.get("multilingual_document.pdf"), null, config)
|
|
println("Detected languages: ${result.detectedLanguages()}")
|
|
}
|
|
```
|