mirror of https://github.com/doccano/doccano.git
pythondatasetsactive-learningtext-annotationdatasetnatural-language-processingdata-labelingmachine-learningannotation-tool
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
811 B
34 lines
811 B
import { DocumentItem, DocumentItemList } from '~/domain/models/document/document'
|
|
|
|
|
|
export class DocumentDTO {
|
|
id: number;
|
|
text: string;
|
|
meta: string;
|
|
annotationApprover: boolean | null;
|
|
commentCount: number;
|
|
isApproved: boolean;
|
|
|
|
constructor(item: DocumentItem) {
|
|
this.id = item.id;
|
|
this.text = item.text;
|
|
this.meta = item.meta;
|
|
this.annotationApprover = item.annotationApprover;
|
|
this.commentCount = item.commentCount;
|
|
this.isApproved = !!item.annotationApprover;
|
|
}
|
|
}
|
|
|
|
export class DocumentListDTO {
|
|
count: number
|
|
next : string | null
|
|
prev : string | null
|
|
items: DocumentDTO[]
|
|
|
|
constructor(item: DocumentItemList) {
|
|
this.count = item.count
|
|
this.next = item.next
|
|
this.prev = item.prev
|
|
this.items = item.items.map(_ => new DocumentDTO(_))
|
|
}
|
|
}
|