Skip to content
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

Language transformer #582

Merged
merged 22 commits into from
Jan 31, 2024

Conversation

toasted-nutbread
Copy link

@toasted-nutbread toasted-nutbread commented Jan 28, 2024

Originally discussed a bit in #581, this is an initial pass of generalizing and extending the deinflector a bit.

With regards to naming, you can see that I have currently gone with Condition, Transform, and Rule for the naming, all of which don't share any suffix and I think still get the point across, but their usages is a bit different than how the old deinflector used terms.

I think this is a bit better because Condition is now named how it is actually used (formerly this was a "Rule"), i.e. that it is used as a condition to test whether a Transform's Rule will match. I'm still open to thoughts on this, but so far I like this paradigm as it avoids the need to have <something>Group and similar (pre|suf)fixed constructs.

  • This is currently a draft as it is a work-in-progress, but I wanted to put it up earlier rather than later in case anyone has thoughts.

This PR now has parity with the old Deinflector. It does not fully support all of the longer-term features I mentioned before as I consider that to be out of scope for a first PR. Mainly, it does not support internationalization or proper combination for loading multiple descriptors.

As a side note, it should be relatively easy to support deinflection of multiple languages simultaneously. While there is currently a limit on the number of condition flags (32), each language should be able to use its own set of condition flags. Adding support for this was again outside the scope of this PR, but it would be easy to create a MultiLanguageTransformer component.

Copy link

github-actions bot commented Jan 28, 2024

✔️ No visual differences introduced by this PR.

View Playwright Report (note: open the "playwright-report" artifact)

@toasted-nutbread toasted-nutbread marked this pull request as ready for review January 28, 2024 19:19
@toasted-nutbread toasted-nutbread requested a review from a team as a code owner January 28, 2024 19:19
Copy link
Collaborator

@djahandarie djahandarie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks like a good incremental improvement. I wish we could use a term in linguistics for this concept of "transformation", but AFAIK there is not one general enough to capture what we want (beyond just deinflections), so I guess this is fine.

@djahandarie djahandarie added this pull request to the merge queue Jan 31, 2024
Merged via the queue into yomidevs:master with commit 3e419aa Jan 31, 2024
5 checks passed
@toasted-nutbread
Copy link
Author

For what it's worth, I did do a little bit of research to see if there were standard terms for what I am describing, but I couldn't find anything beyond more generic than (de)inflection.

@djahandarie djahandarie added the kind/meta The issue or PR is meta label Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/meta The issue or PR is meta
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants