|
@ -45,7 +45,6 @@ |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import EntityItem from './EntityItem' |
|
|
import EntityItem from './EntityItem' |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
components: { |
|
|
components: { |
|
|
EntityItem |
|
|
EntityItem |
|
@ -95,7 +94,6 @@ export default { |
|
|
sortedEntities() { |
|
|
sortedEntities() { |
|
|
return this.entities.slice().sort((a, b) => a.startOffset - b.startOffset) |
|
|
return this.entities.slice().sort((a, b) => a.startOffset - b.startOffset) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
chunks() { |
|
|
chunks() { |
|
|
let chunks = [] |
|
|
let chunks = [] |
|
|
let startOffset = 0 |
|
|
let startOffset = 0 |
|
@ -106,7 +104,6 @@ export default { |
|
|
let piece = characters.slice(startOffset, entity.startOffset).join('') |
|
|
let piece = characters.slice(startOffset, entity.startOffset).join('') |
|
|
chunks = chunks.concat(this.makeChunks(piece)) |
|
|
chunks = chunks.concat(this.makeChunks(piece)) |
|
|
startOffset = entity.endOffset |
|
|
startOffset = entity.endOffset |
|
|
|
|
|
|
|
|
// add entities to chunks. |
|
|
// add entities to chunks. |
|
|
const label = this.labelObject[entity.label] |
|
|
const label = this.labelObject[entity.label] |
|
|
piece = characters.slice(entity.startOffset, entity.endOffset).join('') |
|
|
piece = characters.slice(entity.startOffset, entity.endOffset).join('') |
|
@ -121,7 +118,6 @@ export default { |
|
|
chunks = chunks.concat(this.makeChunks(characters.slice(startOffset, characters.length).join(''))) |
|
|
chunks = chunks.concat(this.makeChunks(characters.slice(startOffset, characters.length).join(''))) |
|
|
return chunks |
|
|
return chunks |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
labelObject() { |
|
|
labelObject() { |
|
|
const obj = {} |
|
|
const obj = {} |
|
|
for (const label of this.labels) { |
|
|
for (const label of this.labels) { |