Commit da7d39aa authored by Kantz's avatar Kantz
Browse files

anpassung der string rep von Source ID um none zu vermeiden

parent 9a69712d
......@@ -273,11 +273,18 @@ class SourceID:
chapter_title: Optional[str]
section_title: Optional[str]
subsection_title: Optional[str]
title: Optional[str]
title: str
doc_type: str
def to_string(self) -> str:
return f"[{self.chapter_title}|{self.section_title}|{self.subsection_title}|{self.title}|{self.doc_type}]"
string_rep = self.title
if self.subsection_title:
string_rep = f"{self.subsection_title}|{string_rep}"
if self.section_title:
string_rep = f"{self.section_title}|{string_rep}"
if self.chapter_title:
string_rep = f"{self.chapter_title}|{string_rep}"
return f"[{string_rep}|{self.doc_type}]"
def _row_to_retrieved(row: Dict[str, Any]) -> Retrieved:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment