Skip to content

schema: Specify the encoding for character offsets#224

Merged
varungandhi-src merged 2 commits intomainfrom
vg/utf-wut
Dec 12, 2023
Merged

schema: Specify the encoding for character offsets#224
varungandhi-src merged 2 commits intomainfrom
vg/utf-wut

Conversation

@varungandhi-src
Copy link
Copy Markdown
Contributor

This PR adds a new PositionEncoding field so that indexers can specify
what type of character offsets they are using. This way, consumers of SCIP
can unambiguously interpret the offsets for non-ASCII data.

I have kept it as a field on Document rather than Index because:

  1. There is no additional benefit from having it on Index because
    occurrences only belong inside Documents, not outside.
  2. It allows one to concatenate indexes from different sources
    which use different kinds of offsets.

Test plan

n/a

@olafurpg
Copy link
Copy Markdown
Contributor

Good point about making this per document. Would make sense to support the same for the text document encoding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants