|
|
|
@ -77,7 +77,7 @@ func MergeAdjacentEntities(entities []*client.TextEntity) []*client.TextEntity {
|
|
|
|
|
excludedIndices := make(map[int]bool)
|
|
|
|
|
|
|
|
|
|
for i, entity := range entities {
|
|
|
|
|
if excludedIndices[i] {
|
|
|
|
|
if excludedIndices[i] || entity.Type == nil {
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -88,7 +88,7 @@ func MergeAdjacentEntities(entities []*client.TextEntity) []*client.TextEntity {
|
|
|
|
|
|
|
|
|
|
// collect continuations
|
|
|
|
|
for j, entity2 := range entities[i+1:] {
|
|
|
|
|
if entity2.Type.TextEntityTypeType() == typ && entity2.Offset == end {
|
|
|
|
|
if entity2.Type != nil && entity2.Type.TextEntityTypeType() == typ && entity2.Offset == end {
|
|
|
|
|
end += entity2.Length
|
|
|
|
|
ei[j+i+1] = true
|
|
|
|
|
}
|
|
|
|
|