[Bug 17302] New: Add Koha::Util::Normalize for normalization functions
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17302 Bug ID: 17302 Summary: Add Koha::Util::Normalize for normalization functions Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org It'd be handy to have one place to look for string normalization routines. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17302 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17302 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 55571 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=55571&action=edit Bug 17302: Add Koha::Util::Normalize for normalization functions This patch introduces Koha::Util::Normalize, which includes the following normalization routines that need no explanation: - remove_spaces - upper_case - lower_case and it also includes: - default: which basically does what C4::Matcher::_normalize does. All routines functionality are fully tested with the included in the included tests. To test: - Apply the patch - Run: $ prove t/Koha/Util/Normalize.t => SUCCESS: All tests pass - Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17302 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au, | |kyle.m.hall@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17302 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Exporter ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17302 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- I still think that the normalization done by C4::Matcher::_normalize is a bad idea to use as a default. We shouldn't be pre-normalizing data before it hits Zebra, because Zebra is going to try to normalize it again for searching using the same method it used to normalize data for indexing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17302 --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to David Cook from comment #3)
I still think that the normalization done by C4::Matcher::_normalize is a bad idea to use as a default.
Yeah, but first things first, if we want this on master. Look at bug 17304, which is part of this effort to make normalization configurable. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17302 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #55571|0 |1 is obsolete| | --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 55591 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=55591&action=edit Bug 17302: Add Koha::Util::Normalize for normalization functions This patch introduces Koha::Util::Normalize, which includes the following normalization routines that need no explanation: - remove_spaces - upper_case - lower_case and it also includes: - legacy_default: which basically does what C4::Matcher::_normalize does. All routines functionality are fully tested with the included in the included tests. To test: - Apply the patch - Run: $ prove t/Koha/Util/Normalize.t => SUCCESS: All tests pass - Sign off :-D Edit: Added Exporter to explicitly export the routines. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17302 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17302 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #55591|0 |1 is obsolete| | --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 55600 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=55600&action=edit Bug 17302: Add Koha::Util::Normalize for normalization functions This patch introduces Koha::Util::Normalize, which includes the following normalization routines that need no explanation: - remove_spaces - upper_case - lower_case and it also includes: - legacy_default: which basically does what C4::Matcher::_normalize does. All routines functionality are fully tested with the included in the included tests. To test: - Apply the patch - Run: $ prove t/Koha/Util/Normalize.t => SUCCESS: All tests pass - Sign off :-D Edit: Added Exporter to explicitly export the routines. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17302 --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 55601 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=55601&action=edit Bug 17302: [Follow-up] Make Normalize.pm undef-resistent Trivial changes for passing undef to the norm routines. Added a few dumb tests too. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17302 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |tomascohen@gmail.com Patch complexity|Trivial patch |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17302 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17302 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #55600|0 |1 is obsolete| | Attachment #55601|0 |1 is obsolete| | --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 55649 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=55649&action=edit [PASSED QA] Bug 17302: Add Koha::Util::Normalize for normalization functions This patch introduces Koha::Util::Normalize, which includes the following normalization routines that need no explanation: - remove_spaces - upper_case - lower_case and it also includes: - legacy_default: which basically does what C4::Matcher::_normalize does. All routines functionality are fully tested with the included in the included tests. To test: - Apply the patch - Run: $ prove t/Koha/Util/Normalize.t => SUCCESS: All tests pass - Sign off :-D Edit: Added Exporter to explicitly export the routines. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17302 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 55650 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=55650&action=edit [PASSED QA] Bug 17302: [Follow-up] Make Normalize.pm undef-resistent Trivial changes for passing undef to the norm routines. Added a few dumb tests too. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17302 --- Comment #10 from David Cook <dcook@prosentient.com.au> --- (In reply to Tomás Cohen Arazi from comment #4)
Yeah, but first things first, if we want this on master. Look at bug 17304, which is part of this effort to make normalization configurable.
I'm not sure how bug #17304 relates to making normalization configurable. Isn't that just adding unit tests? I'm not convinced that there should be any normalization - configurable or hard-coded - either. If we want to normalize data for matching, we should probably be looking at Zebra's normalization rules. On that note, I'd be curious to see how ElasticSearch handles normalization. I looked a bit at how Solr did it a while ago and I recall it leaving a lot to be desired... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17302 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |17318 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17318 [Bug 17318] Make 'Normalization rule' configurable on matchpoint definition -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17302 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Status|Passed QA |Pushed to Master --- Comment #11 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master for 16.11, thanks Marcel, Tomas! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org