#3588 closed defect (fixed)
Search in home view should be done in normalized strings
Reported by: | manuq | Owned by: | manuq |
---|---|---|---|
Priority: | Unspecified by Maintainer | Milestone: | |
Component: | Sugar | Version: | 0.97.x |
Severity: | Unspecified | Keywords: | olpc-test-passed |
Cc: | garycmartin | Distribution/OS: | Unspecified |
Bug Status: | Unconfirmed |
Description (last modified by manuq)
TestCase:
- switch your Sugar to Spanish
- install Abacus, which is named Ábaco in Spanish
- search for "aba" in the home view
- Ábaco should be in the selected activities
This is pretty standard search functionality. Currently, you have to type matching even the character cases. Would be nice to ignore case sensitiveness, and normalize to ASCII equivalents, like 'á' -> 'a'. This can be easily done with the following function:
from unicodedata import normalize def normalize_string(unicode_string): u"""Return unicode_string normalized for searching. >>> normalize_string(u'Mónica Viñao') 'monica vinao' """ return normalize('NFKD', unicode_string).encode('ASCII', 'ignore').lower()
(stolen from http://python.org.ar/pyar/Recetario/NormalizarCaracteresUnicode)
Attachments (1)
Change History (8)
comment:1 Changed 12 years ago by manuq
- Description modified (diff)
comment:2 follow-up: ↓ 3 Changed 11 years ago by erikos
- Cc garycmartin added
- Owner set to manuq
- Status changed from new to assigned
- Version changed from Unspecified to 0.97.x
comment:3 in reply to: ↑ 2 Changed 11 years ago by garycmartin
Replying to erikos:
@gary: do you agree with the postulation above?
@manuq: do you have a working patch based on the snippet above or in reach in a few minutes?
+1 I agree it's a much better behaviour.
comment:4 Changed 11 years ago by manuq
- Keywords r? added
The attached patch covers the three zoom views. Please test.
comment:5 Changed 11 years ago by manuq
- Keywords olpc-test-pending added; r? removed
- Resolution set to fixed
- Status changed from assigned to closed
Pushed with better message and util function in jarabe/util directory as per Simon feedback. Commit number is 6d72b348 .
comment:6 Changed 11 years ago by greenfeld
- Keywords olpc-test-passed added; olpc-test-pending removed
We search based on a normalized version of the input search string and a normalized version of the activity name in OLPC 13.1.0 os7. Searches ignore accents and letter casing in both the Favorites and List views.
Tested with Sugar set to use German and Spanish.
@gary: do you agree with the postulation above?
@manuq: do you have a working patch based on the snippet above or in reach in a few minutes?