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

Adding a handlebar to return pitch accent categories of a word #563

Conversation

arbyste
Copy link

@arbyste arbyste commented Jan 23, 2024

There's a function hidden in the source code called pitchCategories, which returns the pitch accent categories of a word in string format. This pull request adds a new handlebar, called "pitch-accent-categories" which uses this function to return a comma delimited list of pitch accent categories for a word.

For instance, with my set of pitch accent dictionaries, running "pitch-accent-categories" on the word 「推量」returns "heiban,nakadaka", while running it on 「読め」returns "kifuku".

In order to make this work, I needed to fix a logic error in the function isNonNounVerbOrAdjective. As it was, the function would return an incorrect result if the word was both a suru verb and a noun (which is quite a lot of words!) For these words, it should return False, but it was actually returning True. To see the problem, note that in the final return statement, it contains the following expression: !(isSuruVerb && isNoun). With the old logic, there is never a situation where this will evaluate False, it will always return True.

@arbyste arbyste requested a review from a team as a code owner January 23, 2024 01:12
Copy link

github-actions bot commented Jan 27, 2024

✔️ No visual differences introduced by this PR.

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

@djahandarie djahandarie added this pull request to the merge queue Jan 27, 2024
Merged via the queue into themoeway:master with commit 1b9422d Jan 27, 2024
5 checks passed
@arbyste arbyste deleted the feature/pitch-accent-categories-handlebars branch January 27, 2024 14:27
@djahandarie djahandarie added the kind/enhancement The issue or PR is a new feature or request label Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement The issue or PR is a new feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants