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

Deinflection cycle testing #477

Merged

Conversation

toasted-nutbread
Copy link

@toasted-nutbread toasted-nutbread commented Dec 28, 2023

This change is intended to test for cycles in the deinflection definitions.

Currently this is a draft as it is incomplete, just a proof of concept.

Related: #438, #471

Copy link

github-actions bot commented Dec 28, 2023

✔️ No visual differences introduced by this PR.

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

@Casheeew
Copy link
Member

Casheeew commented Dec 28, 2023

What I meant in #471 (comment) was;
At the risk of a contrived example, if there is a rule

{"kanaIn": "てもうた", "kanaOut": "てしまった", "rulesIn": [], "rulesOut": []},
{"kanaIn": "しまった", "kanaOut": "もうた", "rulesIn": [], "rulesOut": []}

then
なってもうた -> なってしまった -> なってもうた -- Cycle!
Which I think is not covered by this implementation yet (my understanding could be wrong)

@toasted-nutbread
Copy link
Author

What I meant in #471 (comment) was; At the risk of a contrived example, if there is a rule

{"kanaIn": "てもうた", "kanaOut": "てしまった", "rulesIn": [], "rulesOut": []},
{"kanaIn": "しまった", "kanaOut": "もうた", "rulesIn": [], "rulesOut": []}

then なってもうた -> なってしまった -> なってもうた -- Cycle! Which I think is not covered by this implementation yet (my understanding could be wrong)

Adding that rule group and setting checkRules=true does yield a cycle:

Cycle detected:
  ?てもうた (start)
  ?てしまった (test, =>, てもうた=>てしまった)
  ?てもうた (test, =>, しまった=>もうた)
  ?てしまった (test, =>, てもうた=>てしまった)

@Casheeew
Copy link
Member

Adding that rule group and setting checkRules=true does yield a cycle:

My misunderstanding then. 😄

@toasted-nutbread
Copy link
Author

In general, the danger comes from situations where kanaOut.length >= kanaIn.length, which is why your first example rule triggered a cycle detection.

@Casheeew Casheeew mentioned this pull request Dec 28, 2023
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.

LGTM. Did you still want to Rebase and test after https://github.com/themoeway/yomitan/pull/547. or are we good to go?

@djahandarie djahandarie added this pull request to the merge queue Jan 28, 2024
Merged via the queue into yomidevs:master with commit a51f1ab Jan 28, 2024
5 checks passed
@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.

3 participants