Skip to content

Commit

Permalink
Resolve #141: Improve full-text search using SQLite's bm25 (#142)
Browse files Browse the repository at this point in the history
# Description

This commit uses SQLite's bm25() auxiliary function to rank the
relevance of full-text search results. It also moves the SQL queries
into a separate header file, to make business logic easier to parse.
Finally, it also boosts the relevance ranking of Cantonese terms from
dictionaries like CCY/WHK/ABY.

Closes #141.

## Type of change

- [x] New feature (non-breaking change which adds functionality)

# How Has This Been Tested?

Tested on Qt 5.15.2 on Pop!_OS 22.04, macOS 12.3.1 Monterey, Windows 11.

# Checklist:

- [x] My code follows the style guidelines of this project (`black` for
Python
  code, `.clang-format` in the `src/jyut-dict` directory for C++)
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have translated my user-facing strings to all
currently-supported languages
- [x] I have made corresponding changes to the documentation
  • Loading branch information
aaronhktan authored Oct 13, 2023
1 parent 9c9d4b9 commit 095ed6e
Show file tree
Hide file tree
Showing 7 changed files with 1,223 additions and 732 deletions.
6 changes: 1 addition & 5 deletions src/jyut-dict/jyut-dict.pro
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ HEADERS += \
logic/search/isearchobservable.h \
logic/search/isearchobserver.h \
logic/search/isearchoptionsmediator.h \
logic/search/searchqueries.h \
logic/search/searchoptionsmediator.h \
logic/search/searchparameters.h \
logic/search/sqlsearch.h \
Expand Down Expand Up @@ -364,11 +365,6 @@ unix|win32:!macx {
QMAKE_EXTRA_COMPILERS += copy_settings
}

# Default rules for deployment.
#qnx: target.path = /tmp/$${TARGET}/bin
#else: unix:!android: target.path = /opt/$${TARGET}/bin
#!isEmpty(target.path): INSTALLS += target

DISTFILES += \
resources/images/chevron-down_inverted.png \
resources/images/chevron-up_inverted.png
Loading

0 comments on commit 095ed6e

Please sign in to comment.