Skip to main content
Bumped by Community user
sharpen title, clarify
Source Link
Erwin Brandstetter
  • 182.2k
  • 28
  • 457
  • 620

How to get lexemes arrayin original sort order from Postgresql ts_vector, sorted by lexems positional information?

PostgresqlPostgres' full text search to_tsvector()to_tsvector() function returns a sorted array of lexemes. I need exactly the same functionthat, but returning unsorted array ofjust with lexemes in original sort order. Is there any such postgresqlPostgres function already available, or do I need to do it myself? How to do itIs so, how?

I need it for Jaro-Winkler string similarity function, for which order of strings/words is important...I I need tsvectortsvector only because of language support for lexemization"lexemization". Actually, I just need to leximizeconvert text, e.g.:

select array_to_string(tsvector_to_array(to_tsvector('english', 'I just want to lexemize this string and keep the original order of lexemes...')), ' ');

This gives me leximized text which is OK, except lexemes are ordered alphabetically instead of their original relative order in original text...

How to get lexemes array from Postgresql ts_vector, sorted by lexems positional information?

Postgresql full text search to_tsvector() function returns a sorted array of lexemes. I need exactly the same function, but returning unsorted array of lexemes. Is there any such postgresql function already available or I need to do it myself? How to do it?

I need it for Jaro-Winkler string similarity function, for which order of strings/words is important...I need tsvector only because of language support for lexemization. Actually, I just need to leximize text, e.g.

select array_to_string(tsvector_to_array(to_tsvector('english', 'I just want to lexemize this string and keep the original order of lexemes...')), ' ');

This gives me leximized text which is OK, except lexemes are ordered alphabetically instead their original relative order in original text...

How to get lexemes in original sort order from ts_vector?

Postgres' full text search to_tsvector() function returns a sorted array of lexemes. I need exactly that, just with lexemes in original sort order. Is there any such Postgres function, or do I need to do it myself? Is so, how?

I need it for Jaro-Winkler string similarity function, for which order of strings/words is important. I need tsvector only because of language support for "lexemization". Actually, I just need to convert text, e.g.:

select array_to_string(tsvector_to_array(to_tsvector('english', 'I just want to lexemize this string and keep the original order of lexemes...')), ' ');

This is OK, except lexemes are ordered alphabetically instead of their original relative order in original text.

Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user