Skip to content

fix: ignore search punctuation in graph queries#994

Closed
azizur100389 wants to merge 1 commit into
Graphify-Labs:v8from
azizur100389:fix/query-punctuation-v8
Closed

fix: ignore search punctuation in graph queries#994
azizur100389 wants to merge 1 commit into
Graphify-Labs:v8from
azizur100389:fix/query-punctuation-v8

Conversation

@azizur100389

@azizur100389 azizur100389 commented May 23, 2026

Copy link
Copy Markdown
Contributor

Summary:

  • Normalize graph query search tokens by stripping punctuation before scoring or node lookup.
  • Add regressions for punctuated query, path/explain lookup helpers, and CLI query behavior.

Why:

Tests:

  • PASS: python -m pytest tests\test_serve.py -k "punctuation or query_terms_strips or query_graph_text_ignores"
  • FAIL: python -m pytest tests\test_query_cli.py -k punctuation (local NetworkX does not support the existing test fixture call node_link_data(..., edges="links"); fixture left unchanged per review)
  • FAIL: python -m pytest (collection stops because local environment is missing optional dependency: ModuleNotFoundError: No module named 'datasketch' in tests/test_dedup.py)
  • PASS: python -m graphify update . (graph rebuilt; graph.html skipped because graph has 5378 nodes, above the default 5000-node visualization limit)

Scope:

  • Intentionally avoids unrelated refactors, dependency changes, and generated-file changes.

@safishamsi safishamsi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! The core fix looks good, but the test file changes are unrelated to the PR's purpose (you've edited test_build.py to modify node_link_data tests that are unrelated to this PR's scope). Could you revert those test changes and keep only the changes relevant to this PR? That will make it easier to review and merge.

@azizur100389
azizur100389 force-pushed the fix/query-punctuation-v8 branch from 2c996b8 to 2b08688 Compare May 24, 2026 01:01
@azizur100389

Copy link
Copy Markdown
Contributor Author

Addressed, thanks. I reverted the unrelated node_link_data fixture compatibility edits and kept the PR scoped to punctuation normalization plus the focused regression tests. I also updated the PR test section to note that the local CLI regression is blocked by the existing NetworkX fixture call after reverting that change.

@azizur100389
azizur100389 force-pushed the fix/query-punctuation-v8 branch from 2b08688 to 14fca7a Compare May 24, 2026 21:43
safishamsi added a commit that referenced this pull request May 27, 2026
…p platform, punctuation search, builtin god-node filter, .svh Verilog (#1040, #1018, #1037, #948, #994, #916, #1042)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@safishamsi

Copy link
Copy Markdown
Collaborator

Implemented in v8 (commit 80301a0). Added _search_tokens helper using re.findall(r'\\w+', ...) that strips punctuation before matching. Updated _query_terms, _score_nodes, and _find_node to use it. Non-Chinese Unicode scripts (Hangul, kana) are handled correctly since the token stripping avoids NFKD normalization on the stored terms. Three new tests (term stripping, _find_node punctuation, query-graph-text integration). All 1390 tests pass. Thanks!

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.

graphify query: punctuation in search terms breaks node matching

2 participants