mirror of https://github.com/doccano/doccano.git
pythonannotation-tooldatasetsactive-learningtext-annotationdatasetnatural-language-processingdata-labelingmachine-learning
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.
42 lines
1003 B
42 lines
1003 B
import { ExampleItem, ExampleItemList } from '~/domain/models/example/example'
|
|
|
|
|
|
export class ExampleDTO {
|
|
id: number;
|
|
text: string;
|
|
meta: object;
|
|
annotationApprover: boolean | null;
|
|
commentCount: number;
|
|
isApproved: boolean;
|
|
fileUrl: string;
|
|
filename: string;
|
|
url: string;
|
|
isConfirmed: boolean;
|
|
|
|
constructor(item: ExampleItem) {
|
|
this.id = item.id
|
|
this.text = item.text
|
|
this.meta = item.meta
|
|
this.annotationApprover = item.annotationApprover
|
|
this.commentCount = item.commentCount
|
|
this.isApproved = !!item.annotationApprover
|
|
this.fileUrl = item.fileUrl
|
|
this.filename = item.filename
|
|
this.url = item.url
|
|
this.isConfirmed = item.isConfirmed
|
|
}
|
|
}
|
|
|
|
export class ExampleListDTO {
|
|
count: number
|
|
next : string | null
|
|
prev : string | null
|
|
items: ExampleDTO[]
|
|
|
|
constructor(item: ExampleItemList) {
|
|
this.count = item.count
|
|
this.next = item.next
|
|
this.prev = item.prev
|
|
this.items = item.items.map(_ => new ExampleDTO(_))
|
|
}
|
|
}
|