Browse Source

Rename repository names

pull/1926/head
Hironsan 2 years ago
parent
commit
427d15ddc1
5 changed files with 15 additions and 15 deletions
  1. 18
      frontend/plugins/repositories.ts
  2. 2
      frontend/repositories/tasks/apiCategoryRepository.ts
  3. 2
      frontend/repositories/tasks/apiSpanRepository.ts
  4. 2
      frontend/repositories/tasks/apiTextLabelRepository.ts
  5. 6
      frontend/services/application/tasks/sequenceLabeling/sequenceLabelingApplicationService.ts

18
frontend/plugins/repositories.ts

@ -2,8 +2,8 @@ import { Plugin } from '@nuxt/types'
import { APITaskStatusRepository } from '@/repositories/celery/apiTaskStatusRepository'
import { APICatalogRepository } from '@/repositories/upload/apiCatalogRepository'
import { APIParseRepository } from '@/repositories/upload/apiParseRepository'
import { APISequenceLabelingRepository } from '@/repositories/tasks/apiSequenceLabeling'
import { APISeq2seqRepository } from '@/repositories/tasks/apiSeq2seq'
import { APISpanRepository } from '@/repositories/tasks/apiSpanRepository'
import { APITextLabelRepository } from '@/repositories/tasks/apiTextLabelRepository'
import { APIConfigRepository } from '@/repositories/autoLabeling/config/apiConfigRepository'
import { APITemplateRepository } from '@/repositories/autoLabeling/template/apiTemplateRepository'
import { APIUserRepository } from '@/repositories/user/apiUserRepository'
@ -16,7 +16,7 @@ import { APILabelRepository } from '@/repositories/label/apiLabelRepository'
import { APIExampleRepository } from '@/repositories/example/apiDocumentRepository'
import { APICommentRepository } from '@/repositories/comment/apiCommentRepository'
import { APIAuthRepository } from '@/repositories/auth/apiAuthRepository'
import { APITextClassificationRepository } from '@/repositories/tasks/apiTextClassification'
import { APICategoryRepository } from '@/repositories/tasks/apiCategoryRepository'
import { APIDownloadFormatRepository } from '@/repositories/download/apiDownloadFormatRepository'
import { APIDownloadRepository } from '@/repositories/download/apiDownloadRepository'
import { APITagRepository } from '@/repositories/tag/apiTagRepository'
@ -60,10 +60,10 @@ export interface Repositories {
relationType: APILabelRepository
// Label
category: APITextClassificationRepository
span: APISequenceLabelingRepository
category: APICategoryRepository
span: APISpanRepository
relation: APIRelationRepository
textLabel: APISeq2seqRepository
textLabel: APITextLabelRepository
boundingBox: APIBoundingBoxRepository
segmentation: APISegmentationRepository
}
@ -110,10 +110,10 @@ const repositories: Repositories = {
relationType: new APILabelRepository('relation-type'),
// Label
category: new APITextClassificationRepository(),
span: new APISequenceLabelingRepository(),
category: new APICategoryRepository(),
span: new APISpanRepository(),
relation: new APIRelationRepository(),
textLabel: new APISeq2seqRepository(),
textLabel: new APITextLabelRepository(),
boundingBox: new APIBoundingBoxRepository(),
segmentation: new APISegmentationRepository()
}

frontend/repositories/tasks/apiTextClassification.ts → frontend/repositories/tasks/apiCategoryRepository.ts

@ -1,7 +1,7 @@
import { AnnotationRepository } from '@/domain/models/tasks/annotationRepository'
import { Category } from '@/domain/models/tasks/category'
export class APITextClassificationRepository extends AnnotationRepository<Category> {
export class APICategoryRepository extends AnnotationRepository<Category> {
labelName = 'categories'
toModel(item: { [key: string]: any }): Category {

frontend/repositories/tasks/apiSequenceLabeling.ts → frontend/repositories/tasks/apiSpanRepository.ts

@ -1,7 +1,7 @@
import { AnnotationRepository } from '@/domain/models/tasks/annotationRepository'
import { Span } from '@/domain/models/tasks/span'
export class APISequenceLabelingRepository extends AnnotationRepository<Span> {
export class APISpanRepository extends AnnotationRepository<Span> {
labelName = 'spans'
toModel(item: { [key: string]: any }): Span {

frontend/repositories/tasks/apiSeq2seq.ts → frontend/repositories/tasks/apiTextLabelRepository.ts

@ -1,7 +1,7 @@
import { AnnotationRepository } from '@/domain/models/tasks/annotationRepository'
import { TextLabel } from '@/domain/models/tasks/textLabel'
export class APISeq2seqRepository extends AnnotationRepository<TextLabel> {
export class APITextLabelRepository extends AnnotationRepository<TextLabel> {
labelName = 'texts'
toModel(item: { [key: string]: any }): TextLabel {

6
frontend/services/application/tasks/sequenceLabeling/sequenceLabelingApplicationService.ts

@ -1,4 +1,4 @@
import { APISequenceLabelingRepository } from '@/repositories/tasks/apiSequenceLabeling'
import { APISpanRepository } from '@/repositories/tasks/apiSpanRepository'
import { APIRelationRepository } from '@/repositories/tasks/apiRelationRepository'
import { Span } from '@/domain/models/tasks/span'
import { Relation } from '@/domain/models/tasks/relation'
@ -8,10 +8,10 @@ import { SpanDTO } from './sequenceLabelingData'
export class SequenceLabelingApplicationService extends AnnotationApplicationService<Span> {
constructor(
readonly repository: APISequenceLabelingRepository,
readonly repository: APISpanRepository,
readonly relationRepository: APIRelationRepository
) {
super(new APISequenceLabelingRepository())
super(new APISpanRepository())
}
public async list(projectId: string, exampleId: number): Promise<SpanDTO[]> {

Loading…
Cancel
Save