ll-in-anki / find-missing-words

Find words in a text that you don't have Anki flashcards for yet
14 stars 0 forks source link

Overhaul Word Select Pane #9

Closed cofinley closed 4 years ago

cofinley commented 4 years ago

Move to QTextBrowser + HTML instead of a QLabel object for each word/token. This should decrease resource consumption and make the text look cleaner. The QLabels with large margins made the text look less readable.

Use cleaner methods of differentiating actual text from punctuation, spaces, symbols, etc. The new methods are more correct, as I found out when trying a longer French text. The apostrophes making the elisions and hyphenated words are poorly parsed. All of these factors made the word select look bad, m'kay.

Before:

After:

The new look is a bit simpler, but the subset of CSS allowed in Qt stylesheets doesn't allow for more padding. On the plus side, I think it looks/reads more like the original text.


P.S. Remove the symbols/punctuation from the default ignored_words in config. These won't be a problem from now on since they aren't considered in the model of valid words that are clickable.

cofinley commented 4 years ago

Measurements

Rough memory usage measurements using ps and the increase in resident set size (rss) memory (also rough).

Small Example

Paragraph, 150 words, 0.8 KB of plaintext

Large Example

Chapter, 3500 words, 21 KB of plaintext


Big takeaways are:

ohare93 commented 4 years ago

1) When I select a word my word window goes half blank :thinking:

image

Goes away when I click again.

Double clicking seems to try and select the whole box, which does something similar but different!

image

1) Why does the "Notes Created" tab only get filled with entries individual to the specific word you have chosen? :thinking: I made three new words, and that view only shoes one entry. Which is the card I made, and changes to show each of them upon clicking the card again. I assumed it would be a list of all the cards. Is it not?

cofinley commented 4 years ago
  1. Why does the "Notes Created" tab only get filled with entries individual to the specific word you have chosen? 🤔 I made three new words, and that view only shoes one entry. Which is the card I made, and changes to show each of them upon clicking the card again. I assumed it would be a list of all the cards. Is it not?

Hmm, not sure what you mean. Can you provide some steps to reproduce this?

Possible problem: did you change the destination deck when adding some of the notes? I noticed that if you change the deck when adding, it won't show up on the notes list once it's created b/c it's technically not found with the original deck filter (if you set one). For example: searching with "Default"as the filter deck, starting a new note from a preset, setting it to another deck, saving the new note, then seeing that the note does not appear in the note list when you click on the word again.

Interesting with the blank screen. I can try Windows, but my Ubuntu was working fine.

ohare93 commented 4 years ago

Sorry, should have replied sooner. Here's a video showing what I mean https://1drv.ms/v/s!An8TBTYs7ARHh_s7mNaZO7tp7wRVEA?e=H4ortJ it also shows some weird graphical issues I've been having :sweat:

On an unrelated note: what program do you use to record things to gifs on Linux :tired_face:

cofinley commented 4 years ago

Sorry, should have replied sooner. Here's a video showing what I mean https://1drv.ms/v/s!An8TBTYs7ARHh_s7mNaZO7tp7wRVEA?e=H4ortJ it also shows some weird graphical issues I've been having 😓

On an unrelated note: what program do you use to record things to gifs on Linux 😫

I use ShareX on Windows and record my Ubuntu VM window, but I've heard good things about OBS, which is available on Linux.

Thanks for the video. That is very odd behavior.... What version of Anki/PyQt are you using? In Anki>Help>About...

I have:

Version 2.1.8 (71e0c880)
Qt 5.12.2 PyQt 5.12.1
ohare93 commented 4 years ago

I use ShareX on Windows and record my Ubuntu VM window, but I've heard good things about OBS, which is available on Linux.

Cool, thanks

Here's my version info:

Version 2.1.0beta36
Qt 5.9.5 PyQt 5.10.1
cofinley commented 4 years ago

Tried on the latest beta build of 2.1.17 on Kubuntu and could not reproduce. Hard to fix without more diagnostic info. Could be that your Qt/PyQt is behind? Merging and closing for now in order to move forward with the overhaul.