Skip to content

Split function for label indices #211

@benknoll-umn

Description

@benknoll-umn

Should add a function which splits a label index into two label indices using an index as a pivot. This function would use a single binary search to identify the middle label and return indices of the labels on either side.

rest_concepts  = concepts
for sentence in sentences:
    sentence_concepts, rest_concepts = rest_concepts.split(sentence.end_index)
    for concept in sentence_concepts:
        pass 

would have half as many binary searches as:

for sentence in sentences:
    for concept in concepts.inside(sentence):
        pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions