File tree Expand file tree Collapse file tree 4 files changed +12
-12
lines changed
Expand file tree Collapse file tree 4 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -215,18 +215,17 @@ def register_validator
215215# ============================================================================
216216
217217# Example OCR backend implementation for custom processing.
218- class CustomOcrBackend
219- def process_image ( image_bytes , language )
220- "Extracted text from #{ image_bytes . length } bytes using #{ language } "
221- end
218+ def register_ocr_backend
219+ backend = Class . new do
220+ def process_image ( image_bytes , language )
221+ "Extracted text from #{ image_bytes . length } bytes using #{ language } "
222+ end
222223
223- def supports_language? ( lang )
224- %w[ eng deu fra ] . include? ( lang )
225- end
226- end
224+ def supports_language? ( lang )
225+ %w[ eng deu fra ] . include? ( lang )
226+ end
227+ end . new
227228
228- def register_ocr_backend
229- backend = CustomOcrBackend . new
230229 Kreuzberg . register_ocr_backend ( 'custom' , backend )
231230
232231 config = {
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ root="$(git rev-parse --show-toplevel)"
77# Source SDKMAN if available
88if [ -f ~ /.sdkman/bin/sdkman-init.sh ]; then
99 set +u
10+ # shellcheck source=/dev/null
1011 source ~ /.sdkman/bin/sdkman-init.sh
1112 sdk use java 25.0.1-tem 2> /dev/null || true
1213 sdk use maven 3.9.11 2> /dev/null || true
File renamed without changes.
Original file line number Diff line number Diff line change @@ -1084,7 +1084,7 @@ fn compile_c_extraction_binary(source: &Path) -> Result<PathBuf> {
10841084
10851085/// Create C adapter (persistent server mode)
10861086pub fn create_c_adapter ( ocr_enabled : bool ) -> Result < SubprocessAdapter > {
1087- let source_path = get_script_path ( "kreuzberg_extract_c.c" ) ?;
1087+ let source_path = get_script_path ( "c/ kreuzberg_extract_c.c" ) ?;
10881088 let binary_path = compile_c_extraction_binary ( & source_path) ?;
10891089
10901090 let args = vec ! [ ocr_flag( ocr_enabled) , "server" . to_string( ) ] ;
@@ -1106,7 +1106,7 @@ pub fn create_c_adapter(ocr_enabled: bool) -> Result<SubprocessAdapter> {
11061106
11071107/// Create C batch adapter
11081108pub fn create_c_batch_adapter ( ocr_enabled : bool ) -> Result < SubprocessAdapter > {
1109- let source_path = get_script_path ( "kreuzberg_extract_c.c" ) ?;
1109+ let source_path = get_script_path ( "c/ kreuzberg_extract_c.c" ) ?;
11101110 let binary_path = compile_c_extraction_binary ( & source_path) ?;
11111111
11121112 let args = vec ! [ ocr_flag( ocr_enabled) , "batch" . to_string( ) ] ;
You can’t perform that action at this time.
0 commit comments