Skip to content

Commit

Permalink
update to a newer version of mwe-query with fixes (#95)
Browse files Browse the repository at this point in the history
* updated tree expansion method

* allow searching for canonical forms in admin panel
  • Loading branch information
bbonf authored Dec 19, 2023
1 parent 6298a66 commit 8087595
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit 8087595

Please sign in to comment.