Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for tsvector #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Support for tsvector #47

wants to merge 2 commits into from

Conversation

Glandos
Copy link

@Glandos Glandos commented Feb 26, 2025

This is the first and basic step.

A tsvector can be defined in Python with a list of tuple (lexeme, positions). positions is a list of position, either int or str (e.g. '1A').
Full example:

[
        ('aà', ['1A', '3A']),
        ('b', ['2A']),
]

A lot of things are missing right now:

  • Documentation
  • Tests
  • Encoding support
  • A better API for tsvector in Python

For encoding, lexemes should be encoded using client connection, but the automatic encoder isn't made for that. Maybe client_encoding could be passed as optional kwargs to every formatter?

For the last point, it's good to remember that tsvector are sorted, and I've no intention of supporting the creation of such a thing (see to_tsvector) which is very complicated to replicate in Python.

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.

1 participant