-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lookup all codepoints with general_category (eg) "Lu" #213
Comments
By any chance are you using a Mac? Apple's case-insensitive file system strikes again... Try this: TwitterCldr::Shared::CodePoint.code_points_for_property('General_Category', 'Lu') You can also use "gc" in place of "General_Category". This could be a bit more forgiving of capitalization :) |
I am indeed using a Mac. okay then! I wonder if there's any way to have the code catch/correct. maybe not. I guess I should have noticed that the
okay! Without having that working, I was trying to iterate through every single codepoint and checking it's general_category property, just now I interupted the process 2.5 hours in and still not finished, heh. |
Oh wait, it's not just the case for I wonder if there is some way to have the code recognize known property names (it is a finite and compile-time known set, right?), and case them properly -- or maybe better, just raise if you use one that isn't valid. So you know you're doing something wrong, instead of just getting empty set back. |
Yeah, the gem should be able to normalize the property name so this doesn't happen in the future. We can leave this issue open until I can get to fixing it. Or, if you've got time for a pull request, the place to look is |
I wonder if normalizing is really the right goal, or just raising on unrecognized properties. I can totally make a property up (in real life: typo, or confusion about what property names are), and get no indication I did something wrong, just get an empty set result.
Shouldn't that raise? |
Maybe? Is that what you would expect as a client of the interface? |
Myself, yes. |
Ok, I'm cool with that. |
I totally forgot to do this for v5.0, dang it. I would consider it a breaking change meaning it should be released with a major version bump. Hopefully this isn't too big a deal for clients of the lib. Crossing my fingers I remember to look through old issues before releasing v6.0 whenever that happens to be. |
What makes it a breaking change, that you can get a raise instead of empty return value on invalid input? Doh. I guess it could be released with an opt-in of some kind, either globally or as an argument to the method call. Alternately, oh this is probably better, you could provide a different method name with the input normalizing/validating before. But I personally haven't been working too much in this area lately. |
Oh yeah, I like the different method name idea. What about |
I see the fancy code for using a trie to lookup codepoints with certain properties, but either it doesn't work for
general_category
, or I'm not using it right.(PS: Thank you for this awesome gem, a real service to the community)
The text was updated successfully, but these errors were encountered: