Closed dchiller closed 2 months ago
@lucasmarchd01 Could you review?
@lucasmarchd01 @annamorphism Do you have thoughts about the name of the pitch search?
I agree that pitch(invariant) should give only cdecd results in this case. (as an aside, why are all the contours different shapes?) I think there must be a better way to signal that the "Pitch" search includes transpositions, though. (In CantusDB's melody search they are, respectively, "Exact match" and "Exact match+transpositions," which is maybe a little wordy for the dropdown, but clear...)
Yeah, I guess the word "invariant" probably isn't the best choice because it can mean two different things in this context.
What about one of these?
Yes, something like Pitch (exact) and Pitch (pattern) could work. I like "flexible" too, but wonder if it suggests that you'd get some sort of fuzzy match and not an exact match for a transposition.
as an aside, why are all the contours different shapes?
It's a good question. These images are from the way-old archive site, so I don't really know (I do know that this is using old and very incorrect MEI). They are correct as far as I can tell with the new files so :shrug:
I like "Pitch (exact)"... and maybe either "Pitch (pattern)" or "Pitch (transposed)"
Note that there is also an "Interval" search so you could just search for a perfect 5th and get all transpositions of "c - g" except for "b - f".
The
SearchNotation
view was refactored and reorganized for clarity and to include type annotations and a variety of checks on the passed parameters. Searches for neume names, both transposed and fixed pitches, and contour are supported. Thetext
andincipit
searches were removed because they are handled by the normal search view. Theinterval
search was removed for now because it has not yet been implemented in the MEI parsing and indexing. An issue to add it back has been created (#875).One odd thing is that on the old version of OMR search,![image](https://github.com/DDMAL/cantus/assets/11023634/c0e0238a-c1f4-4607-967b-8f627ee27fde)
Pitch
search did not search transpositions of pitches, whilePitch (Invariant)
search did. See images. To me, that seems the wrong way around. I've kept this labeling that way in this PR, but I'm curious for @lucasmarchd01 and @annamorphism's opinion. UPDATE: The relevant places in this PR have been updated to that queries ofpitch_names
type do not search transpositions, while queries of typepitch_names_transposed
do search transpositions.The rewrite of the
SearchNotationView
necessitated the change of some functions insearch_utils.py
:validate_query
, that tests whether or not a query string for a particular type of OMR search (neume names, pitches, etc.) is validtranspose_up_unicode
, which was renamed fromtransposeUp
and uses the unicode for note names to transpose a note up one stepget_transpositions
, which gets all diatonic transpositions of a given sequence of note names Tests for these functions were added.This PR introduces the use of the
json
transformer on thelocation
field in solr. With this change, the solr server returns a json object in the location field (when parsed in python, this is then a dictionary), rather than a string of json that must then be separately parsed in python or javascript. This feature is added by modifying the solr config file and (for clarity) changing the name of thelocation
field tolocation_json
.Closes #874.