-
Notifications
You must be signed in to change notification settings - Fork 5
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
Support graft-chimeras #194
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice patch @tobymarsden, thank you. Let me talk to our botanists, and meditate on it over weekend.
I think it is OK, because gnparser in general uses very 'broad' semantics in other parts, for example |
@dimus Awesome, thanks for looking at this! |
@tobymarsden I asked around, and looked at the codes. It seems that graft-chimeras are completely in the realm of cultivars code, so it would be logical to parse them only when cultivar flag is on. Can you make this change in your PR and make them 'visible' only if cultivar flag is used? I think their tests also should be in cultivar test file. |
I think if people go through names that suppose to be in ICN context, parser should break on graft-chimera names. |
@dimus Makes perfect sense. I'll try to find some time this week to make the changes to the PR. |
sounds great @tobymarsden |
e1a848d
to
5935f18
Compare
5ae8533
to
605b468
Compare
@dimus The graft-chimera support is now contingent on the I've updated the tests so the parsed graft-chimeras are in the cultivars file, and the main test file shows |
@tobymarsden perfect! Trying it now... |
It all looks good to me, @tobymarsden, great work, merging... |
I'm trying to get gnparser to parse all names in Kew's Plants of the World Online.
I bumped into a parsing failure when dealing with graft-chimeras, e.g.
This PR parses these names successfully without any impact on existing test cases, e.g.
and
I've reused the
hybrid
flag to make consumption of the JSON output easier; notwithstanding that these aren't true botanical hybrids, it seems reasonable to use the term in the broadest sense given that it's a string value with more details anyway.I had to adjust the stemmer but I added some stemmer-specific tests in.
The PR duplicates much of the HybridFormula code as the syntax is so close; I've another branch which refactors things to reuse the HybridFormula objects, but there was no performance benefit and the code is harder to follow (for me, anyway). If you prefer that approach, though, I can submit a PR from that branch instead.