Overview
Comment: | SQLiteStorage.find_courses(term) now also finds the non-hyphenated version of hyphenated words. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | development |
Files: | files | file ages | folders |
SHA3-256: |
6a7c31f7091ab04c4b1a9b5243ab1d3a |
User & Date: | florian 2024-10-15 12:23:59 |
Context
2024-10-16
| ||
10:15 | Merged changes from view. check-in: 5e71483a64 user: florian tags: development | |
2024-10-15
| ||
15:43 | Merged changes from development. check-in: 250e22e3e6 user: florian tags: view | |
12:23 | SQLiteStorage.find_courses(term) now also finds the non-hyphenated version of hyphenated words. check-in: 6a7c31f709 user: florian tags: development | |
2024-08-05
| ||
16:28 | SQLiteStorage.find_courses(term) now returns the match ratio along with the matching courses. The course list is now sorted by match ration if a term was given. check-in: 127ed83d53 user: florian tags: development | |
Changes
Changes to luna_lms/storage/sqlite_storage.py.
︙ | ︙ | |||
193 194 195 196 197 198 199 | terms = terms.lower() # First, use the built-in all whitespace split. # terms = terms.split() | | > > | | | > | | | | 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | terms = terms.lower() # First, use the built-in all whitespace split. # terms = terms.split() # Then, add split versions of hyphenated words, and # also a version with hyphens removed. # We want to be able to to a similarity search # on the compound, with and without hyphens, as well # as on the parts of these. # hyphen_alternatives = [] for t in terms: if "-" in t: hyphen_alternatives.extend(t.split("-")) hyphen_alternatives.append(t.replace("-", "")) if len(hyphen_alternatives): LOGGER.debug("Added {} alternatives to hyphenated terms".format(len(hyphen_alternatives))) terms.extend(hyphen_alternatives) self.terms[identifier] = set(terms) # We use the built-in difflib for a fuzzy search. # We evaluate term by term, and decide by the highest # similarity. |
︙ | ︙ |