use super::{CsvProcessor, FileProcessor};
use anyhow::Result;
use std::path::Path;
pub struct TsvProcessor;
impl FileProcessor for TsvProcessor {
fn process(&self, content: &[u8], path: &Path) -> Result<String> {
let csv_processor = CsvProcessor;
match csv_processor.process_with_delimiter(content, b'\t', path) {
Ok(mut result) => {
result = result.replace("CSV Schema", "TSV Schema");
Ok(result)
}
Err(e) => {
log::warn!(
"TSV parsing failed for {:?}: {}. Using raw text fallback.",
path,
e
);
let fallback = super::DefaultTextProcessor;
fallback.process(content, path)
}
}
}
}