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.

28 lines
697 B

  1. import { AnnotationModel } from './interface'
  2. export class SequenceLabelingLabel implements AnnotationModel {
  3. constructor(
  4. public id: number,
  5. public label: number,
  6. public user: number,
  7. public startOffset: number,
  8. public endOffset: number
  9. ) {}
  10. static valueOf(
  11. { id, label, user, start_offset, end_offset }:
  12. { id: number, label: number, user: number, start_offset: number, end_offset: number }
  13. ) {
  14. return new SequenceLabelingLabel(id, label, user, start_offset, end_offset)
  15. }
  16. toObject() {
  17. return {
  18. id: this.id,
  19. label: this.label,
  20. user: this.user,
  21. start_offset: this.startOffset,
  22. end_offset: this.endOffset
  23. }
  24. }
  25. }