Repository navigation
Read a query's words as the text's expression does, Alphabetic letters, decimal digits and underscores (#434) - #437
Draft
jasperblues wants to merge 2 commits into
Draft
jasperblues wants to merge 2 commits into
jasperblues wants to merge 2 commits into
Conversation
…s, decimal digits and underscores (#434) Port of liberation-data/drivine4j#616 (drivine4j PR #627). \W split a Hindi word at its vowel sign, so it never matched, and kept ² in a word where the text ends one at it. The class is built from sqlite_patterns' Alnum ranges, on the first query rather than on import.
…ers, and say in the docs what a word is (#434)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #434. Port of liberation-data/drivine4j#616 (drivine4j PR #627), as liberation-data/drivine#643 ports it. Not to merge until train 2026.11.1 is published, and not before drivine#643.
text_query.pysplit a full-text query into words with\W. Python's\wis whatstr.isalnumholds, plus_. So it kept²,½andⅻin a word, and split a Hindi word at its vowel sign, whichisalnumdoesn't hold.A term's expression reads the text with
[[:alnum:]_], which on Postgres, and throughsqlite_patterns(Java's\p{Alnum}), is Unicode's Alphabetic plus decimal digits. So किताब never matched, and²stayed in a word where the text, and Neo4j's analyzer, end one at it.A query's words are now split by
_gap(): not Alphabetic,Ndor_, built fromsqlite_patterns.property_ranges("Alnum")andclass_text. It is built on the first query rather than on import, because it reads every code point (about 85 ms).Goldens: unchanged.
Tests
tests/integration/test_bm25.py, and its sync copy, on Neo4j, Postgres, Postgres indexed, SQLite and Oracle: किताब is found, and"m²x"finds "an m² x here".many's pinned score is 0.0989 for the two new seed texts.tests/unit/test_text_query.py:bⅻb,m²x,1½2,٣٤andm\²x;[[:alnum:]_]and a query's words hold the same characters.Verification
[[:alnum:]_]pin and the docs notes (docs/02-connecting.md,docs/07-schema.md); pass 2 came back clean.