From a871e19c2e0aa3c94e338a27f4cc73b76d8ff9c0 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Wed, 11 Nov 2020 00:29:11 +0100 Subject: specify result schema --- fuzzycat/cluster.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/fuzzycat/cluster.py b/fuzzycat/cluster.py index 201ee28..ee23979 100644 --- a/fuzzycat/cluster.py +++ b/fuzzycat/cluster.py @@ -49,6 +49,21 @@ class KeyDoc(BaseModel): title: Optional[str] contribs: Optional[List[Contrib]] +class ClusterResult(BaseModel): + """ + Result of clustering. + + XXX: We could also include the complete document, that would keep it simple + at the expense of a few more things to read. + """ + key: str + values: List[str] + comment: str + ids: str + title: str + contribs: str + year: str + get_ident_title = operator.itemgetter("ident", "title") ws_replacer = str.maketrans({"\t": " ", "\n": " "}) -- cgit v1.2.3