docs(core): 为 ddddocr-core 全量补充并精简 Rustdoc 文档
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
//! OCR 构建器。
|
||||
|
||||
use crate::ocr::executor::Ocr;
|
||||
// use ddddocr_tract::session::OcrSession;
|
||||
use crate::traits::OcrEngine;
|
||||
use crate::ocr::color_filter::ColorFilter;
|
||||
use crate::ocr::token_filter::TokenFilter;
|
||||
|
||||
/// OCR 构建器:配置识别选项后绑定引擎会话构建 [`crate::Ocr`]。
|
||||
#[derive(Default)]
|
||||
pub struct OcrBuilder {
|
||||
/// 是否修复PNG格式问题
|
||||
@@ -49,6 +53,7 @@ impl OcrBuilder {
|
||||
self.charset_restrict = Some(Box::new(restrict));
|
||||
self
|
||||
}
|
||||
/// 绑定引擎会话并构建 OCR 识别器。
|
||||
pub fn build_with<E: OcrEngine>(self, runtime: &E) -> Ocr<'_> {
|
||||
// 1. 原地解析颜色过滤器
|
||||
let final_color_ranges = match &self.color_filter {
|
||||
|
||||
Reference in New Issue
Block a user