Skip to content

Parse bracket-quoted SQLite column names - #6192

Closed
adityajai119 wants to merge 1 commit into
sqlmapproject:masterfrom
adityajai119:sqlite-bracket-quoted-columns
Closed

adityajai119 wants to merge 1 commit into
sqlmapproject:masterfrom
adityajai119:sqlite-bracket-quoted-columns

Conversation

@adityajai119

Copy link
Copy Markdown

spacy.util.get_words_and_spaces says it takes Iterable[str]. It doesn't keep it.

It joins words to check the text, then loops over words again. Pass a generator and that first pass eats it. You get the whole text back as one token.

Here's what I got with iter(["'", "dogs", "'", "run"]) and the text " 'dogs'\n\nrun ": one token, where the list version returns 7. That broke Doc creation in spacy/tests/doc/test_creation.py.

It's a one-line fix: call list(words) once at line 1504 of spacy/util.py. I added test_create_from_words_and_text_iterator to that test file. python -m pytest spacy/tests/doc/test_creation.py -q now reports 6 passed.

@stamparm stamparm closed this in e2efd61 Nov 30, 2026
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