Nomad changes
All checks were successful
Deploy fil (kreuzberg) / deploy (push) Successful in 49s

This commit is contained in:
Henrik Jess Nielsen
2026-06-01 23:40:55 +02:00
parent 72b1a0a6ed
commit b4c07d3693
5723 changed files with 1130655 additions and 0 deletions

View File

@@ -0,0 +1,78 @@
```csharp title="C#"
using Kreuzberg;
using System.Collections.Generic;
public class CloudOcrBackend : IOcrBackend
{
private string _apiKey;
public string Name => "cloud-ocr";
public string Version => "1.0.0";
public CloudOcrBackend(string apiKey)
{
_apiKey = apiKey;
}
public void Initialize()
{
}
public void Shutdown()
{
}
public ExtractionResult ProcessImage(byte[] imageBytes, OcrConfig config)
{
// Call cloud OCR API with imageBytes and config.Language
// Return ExtractionResult with extracted text
throw new NotImplementedException();
}
public ExtractionResult ProcessImageFile(string path, OcrConfig config)
{
var imageBytes = File.ReadAllBytes(path);
return ProcessImage(imageBytes, config);
}
public bool SupportsLanguage(string language)
{
return SupportedLanguages().Contains(language);
}
public OcrBackendType BackendType()
{
return OcrBackendType.Cloud;
}
public List<string> SupportedLanguages()
{
return new List<string> { "eng", "deu", "fra" };
}
public bool SupportsTableDetection()
{
return false;
}
public bool SupportsDocumentProcessing()
{
return false;
}
public ExtractionResult ProcessDocument(string path, OcrConfig config)
{
throw new NotSupportedException("Document processing not supported by CloudOcrBackend");
}
}
class Program
{
static void Main()
{
// Register the backend
var backend = new CloudOcrBackend(apiKey: "your-api-key");
OcrBackendBridge.Register(backend);
}
}
```