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

Refactor: Replacing Conditionals with Polymorphism #33

Conversation

kishore7403
Copy link
Contributor

@kishore7403 kishore7403 commented Apr 4, 2023

Created a new interface KeyEventAction which has a single method execute that takes an ActivationViewManager as an argument. Created six new classes 1. MAction, 2. EAction, 3. RAction, 4. BAction, 5. LAction, 6. OAction that implements this interface and overrides the execute method.

This approach can make the code easier to read and maintain, especially if new cases are added later since you can simply create a new class that implements the common interface or extends the common superclass.

However, I suggest running the test cases related to DebuggerKeyListener to ensure it does not break the code.

@aika-algorithm
Copy link
Owner

Thank you. The code looks fine and I will test it today.

@aika-algorithm aika-algorithm merged commit a89792c into aika-algorithm:master Apr 5, 2023
@kishore7403
Copy link
Contributor Author

kishore7403 commented Apr 5, 2023

Can you upload the test cases to the repo, so I can quickly test my changes?
It can also give me a better understanding of how the project works.

@aika-algorithm
Copy link
Owner

There currently aren't that many test cases. Major refactorings were necessary to migrate from version one to version two of the algorithm, making most of the existing test cases obsolete. Also, during the development of version two, the code base was simply too unstable and would have required constant rewriting of the test code base. I'm currently still busy stabilizing the case base and will undoubtedly need to add more test cases in the future.

@aika-algorithm
Copy link
Owner

I think a good starting point is the SyllablesExperiment class. The idea behind this experiment is to detect syllables as frequent patterns within a test corpus. Additionally, these patterns should be able to suppress each other during training if they are overlapping. This experiment however is still a work in progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants