update
This commit is contained in:
@@ -4,6 +4,7 @@ pub mod person;
|
||||
pub mod tag;
|
||||
pub mod favorite;
|
||||
pub mod recommend;
|
||||
pub mod parse;
|
||||
|
||||
pub use album::*;
|
||||
pub use image::*;
|
||||
|
||||
27
src/models/parse.rs
Normal file
27
src/models/parse.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
//! 相册解析结果 — 单个相册标题的一次性解析产物
|
||||
//! 用于串联并行解析(Phase 1a)和批量写库(Phase 1b)
|
||||
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
/// 一次 title 解析的完整结果
|
||||
///
|
||||
/// 在一个相册上通过一次 jieba 分词,同时提取:
|
||||
/// - 人名 + 别名(含 include 扩展、prefix 移除)
|
||||
/// - 标签列表(含分类)
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ParseResult {
|
||||
/// 相册 UUID
|
||||
pub album_id: String,
|
||||
/// 最终人名 | None = 未找到
|
||||
pub person_name: Option<String>,
|
||||
/// 中文主名(split_person_name_with_aliases 后的 primary)
|
||||
pub person_primary: Option<String>,
|
||||
/// 标签列表 (tag, category)
|
||||
pub tags: Vec<(String, String)>,
|
||||
}
|
||||
|
||||
impl ParseResult {
|
||||
pub fn new(album_id: String) -> Self {
|
||||
Self { album_id, person_name: None, person_primary: None, tags: Vec::new() }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user