-
Notifications
You must be signed in to change notification settings - Fork 49
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
Refactoring of deinflection of verbs #1814
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.
In general, this looks great. Thank you!
Two comments:
-
Do you think we need to update the description of
DeinflectRule
given these recent changes?(While we're at it, perhaps we should (i) move
DeinflectRule
andType
beforedeinflectRuleData
, (ii) MakeDeinflectRule
atype
rather than aninterface
, (iii) label the tuple elements ofdeinflectRuleData
, e.g.[from: string, to: string, toType: number, fromType: number, reason: Reason]
?) -
I wonder how important defining
InitialOrMasu
andIchidanOrKuru
are? My hunch is that it would be simpler and clearer just inlining the definitions for these?
Likewise, thank you for your input!
You're right, I completely overlooked this. I will update the description to reflect these changes including adding a few lines about the new intermediate types.
The main reason for defining |
Thank you!
Ah, yes, that makes sense. Yes, you can tell Prettier not to wrap the array by preceding it with |
Update:
I will squash the commits after your review. |
Thinking about it, I’d like to change the "reason" field to an array to eliminate the need for compound forms like PolitePast, PolitePastNegative, etc. This would be an user-facing change because for example, 食べませんでした would be parsed as In the future, this would allow us to parse forms like 食べへんかった as Would you be okay with this change? And if so, should that be a separate PR? |
Looks good! I added a few minor suggestions just now.
Sorry, I didn't mean to change
Thank you! Don't worry if it's too much work, but if it's possible to have one commit where we move the order of the |
I think "polite past negative" might be preferable to most Japanese learners. Even if "< polite < negative < past" is more accurate linguistically, I think most learners learn ~ませんでした as a set and are used to thinking of it as such so I think "< polite < negative < past" might actually be less useful.
I've been looking forward to tackling dialects for a while. This will be great! I think in this example I'd actually prefer the annotation for 食べへんかった to read "(Kansai-ben) < negative < past".
Given that this is a functional change, I think a separate PR / issue would be better so we can discuss the user-facing impact. Thank you so much! |
178c931
to
1e2f447
Compare
- add three intermediate types: TaTeStem, DaDeStem, and MasuStem for Godan verbs - abstract inflections following these stems - introduce Reason.None to forward TaTe/DaDe-stem forms to plain verb form - remove specialized implementations now covered by new types
1e2f447
to
5da4e53
Compare
The changes inside the
Is this acceptable as well? |
(I really wonder why it became the standard learning Japanese in a complicated way. ^^)
Cool, I have a working branch for better 敬語 support, which would also benefit from the possibility to add multiple reasons to one rule (ませ as |
Sorry for the delay in reviewing. I wanted to go through it properly on a large screen. It looks great. Thanks for splitting up the commits too—that made it much easier to review. |
I'm not too worried which form we end up with. My initial reaction to "< polite < negative < past" was just that it looked complicated for something that is reasonably common but maybe that's more to do with the "<" delimiters. Maybe we should consider another way of combining the reasons?
Sounds great. I have long-term ambitions of doing some really helpful things with お聞きしたい, ご利用になる, 御手紙, おビール etc. but the implementation for that will be quite different.
By all means. Looking forward to it! Thanks again! |
Absolutely no worries. Thank you for reviewing and merging this!
Maybe it would help already making them a little bit smaller, like "‹ polite ‹ negative ‹ past"? (I will open a thread in Discussions for this.)
Interesting. I can imagine this to be a little bit more complicated to implement, but it would be a nice level up for 10ten. |
Related to #1811.
Overview
This pull request introduces three new intermediate types for deinflection of Godan verbs:
(Ichidan verbs, with their single stem, would not benefit from these changes.)
These intermediate types allow for the abstraction of inflections that follow them. Specifically:
After TaTeStem/DaDeStem-stem:
After MasuStem:
To help with that,
Reason.None
has been introduced and is used when forwarding TaTe/DaDe-stem forms to the plain verb form. This step is irrelevant for subsequent data processing, so while deinflection, it will never be added to thereasons
array.Benefits