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

update to a newer version of mwe-query with fixes #95

Merged
merged 2 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/mwe/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

@admin.register(CanonicalForm)
class CanonicalFormAdmin(admin.ModelAdmin):
pass
search_fields = ('text',)


@admin.register(XPathQuery)
Expand Down
4 changes: 2 additions & 2 deletions backend/search/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from services.basex import basex

from sastadev.treebankfunctions import indextransform
from mwe_query.lcat import expandnonheadwords
from mwe_query.canonicalform import expandfull

import logging

Expand Down Expand Up @@ -104,7 +104,7 @@ def _get_or_create_components(component_slugs, treebank):
def filter_expand(results: ResultSet) -> ResultSet:
for result in results:
try:
result.tree = indextransform(expandnonheadwords(result.tree))
result.tree = expandfull(result.tree)
except Exception:
log.exception('Failed expanding index nodes for sentence')
yield result
Expand Down
Loading