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

Enable Pitch Accents #157

Closed
ian-battaglia opened this issue Feb 24, 2023 · 11 comments
Closed

Enable Pitch Accents #157

ian-battaglia opened this issue Feb 24, 2023 · 11 comments
Assignees
Labels
enhancement New feature or request

Comments

@ian-battaglia
Copy link

I put this under "Discussions" a while back since I didn't think it was really an issue, but maybe this is a better place for it.

I just started using jidoujisho, version 2.3.7, and it's really impressive! I'm able to mirror my mining setup on mobile with it. Only issue is that I haven't been able to get the pitch accent graph working.

I'm using a card template that's a slightly older version of this one, which adds a pitch accent graph from Kanjium into a field called "Graph." I was looking at the update from when pitch accents were added, 0.17, which is supposed to have a link to the template on how to add the CSS to your cards, but that link is dead. How should I get this to work?

I have two other questions as well, not sure if these should be spun off into their own "issues."

  1. How can I enable the ImmersionKit integration mentioned in 2.2? I'd like to use it to pull sentences and images from if I pull up a word in the dictionary or in a novel, but it's not clear to me how I can enable this.
  2. Is it possible to limit which dictionary definitions get added to a card? I have four dictionaries loaded that I like to reference, but usually only want one or two on a card. Is it possible to configure that from the start rather than manually deleting unneeded entries each time?

Thanks!

@arianneorpilla
Copy link
Owner

You will need this CSS under your template.

.pitch{
  border-top: solid red 2px;
  padding-top: 1px;
}

.pitch_end{
  border-color: red;
  border-right: solid red 2px;
  border-top: solid red 2px;  
  line-height: 1px;
  margin-right: 1px;
  padding-right: 1px;
  padding-top:1px;
}

I recommend making a new field for it beside what your current template uses, and using those two fields, one for your current implementation and another for my format. In the future, I will probably make an enhancement that sets the pitch accent to be of other more common formats rather than my own format that I botched up together.

For your other questions,

  1. You can enable the ImmersionKit integration by enabling it as an enhancement under User enhancements and then using the new button you'll find after enabling it on the Term field.

  2. This is not possible in the current version.

Let me know if you still have any trouble. I am currently at the early development stages of something that I am carefully working on this time while taking much better care of myself (and for the codebase for that matter), so I see myself as in hiatus and not actively looking to make new releases for the current major version at this time, unfortunately.

@ian-battaglia
Copy link
Author

Awesome, thanks! Got that all to work. I was expecting the ImmersionKit user enhancement to be under "sentence" instead of "term," but that's all set up now.

Appreciate all your hard work. I'd love in the future to be able to do graphs like these as I think they're a little nicer, but not essential at all.

Screenshot 2023-02-25 120417

Finally, is it possible to enable some of these frequency dictionaries in JidouJisho? I have them added, but haven't seen them pop up. I like to have some way of checking that a word I'm considering adding isn't too uncommon or archaic, and sometimes get a note about the JLPT level, but these would be awesome to add to the dictionary.

Thanks again!

@arianneorpilla
Copy link
Owner

Hey, @ian-battaglia. Missed an edge case which caused issues importing those dictionaries you've linked. I've included the fix for that in a new build below.

This build includes a work in progress 2.4.0 (only supporting Japanese at the moment) that includes an overhaul of the dictionary system and should be much, much faster than the current system, supports wildcard searching (? or ? for one character, * or ※ (こめ) for zero to any characters) but will require a fresh installation. You can get the build here.

As for the graphs, I can probably support them as an enhancement you can enable -- Would you be willing to share the internal structure/how the graphs in your current template work?

@arianneorpilla
Copy link
Owner

Changes for the frequency dictionaries have been included in the 2.4 preview.

@ian-battaglia
Copy link
Author

This is great, thanks so much! Going to download and get this running now.

As for the pitch accent graphs, I think they're just natively included as part of the Kanjium Pitch Accent Dictionary. In Yomichan, if you hit the "advanced" settings toggle, there's a few different options for pitch accent graph under the "appearance" tab. Not sure how easy or hard copying this implementation over would be, but it'd definitely be nice to have.

Thanks for all your hard work!

@arianneorpilla
Copy link
Owner

It would help me if you could share how your CSS and card format looks -- I can probably guess backwards based on the output how to implement it.

I'll probably implement it as an enhancement which modifies how the pitch accent text is generated in the Creator.

@arianneorpilla
Copy link
Owner

For picking out which dictionary definitions get exported, I'm trying to figure out a good user experience for the feature at the moment.

My current idea is to make an auto enhancement for the expanded and collapsed meaning fields that changes the behaviour to "currently expanded" and "currently collapsed" upon opening the Creator or so.

I've had some users think that that should be the default behaviour of the field too, I'd like to implement a way to do it without having the user manually adjust things in the Creator itself, and to allow them to continue to use the app organically as they already would.

@ian-battaglia
Copy link
Author

share how your CSS and card format looks

Sure thing. These graphs actually just get dropped directly into the field as it comes in from Yomichan, really not sure how they're rendering it. Here are some screenshots of a sample card I made with Yomichan that has that graph format.

Screenshot 2023-03-03 at 10 51 07 AM

Screenshot 2023-03-03 at 10 50 52 AM

Screenshot 2023-03-03 at 10 50 33 AM

Screenshot 2023-03-03 at 10 50 28 AM

Screenshot 2023-03-03 at 10 50 18 AM


Re: selective definition export, that sounds great. For example, my set up is primarily the 明鏡国語辞典 and 大辞林 dictionary, plus JMdict and KireiCake for slang or whatever. But when I actually make a card, I usually just want the actual dictionary definition from 明鏡国語辞典 (not the part of speech or whatever) and sometimes the first definition or so from JMDict. Right now, I've been just exporting the cards as default, and just going through and editing the definition field in Anki before I review for the day.

@arianneorpilla
Copy link
Owner

Hi @ian-battaglia. Just reaching out to let you know selective definition export is available in 2.5.

I'm not closing this issue yet as I still want to make the pitch accent diagrams template and CSS agnostic, and I'd like to make some modifications to the default template while I'm at it.

@arianneorpilla arianneorpilla self-assigned this Apr 11, 2023
@arianneorpilla arianneorpilla added the enhancement New feature or request label Apr 11, 2023
@ian-battaglia
Copy link
Author

Awesome, thanks!

@arianneorpilla
Copy link
Owner

Closing now that 2.7 has template-agnostic pitch accent diagrams that use SVG.

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

No branches or pull requests

2 participants