AF-VCD / pdf-bullets

Web-based utility for writing Air Force Bullets (EPR/OPR/Awards)
MIT License
45 stars 38 forks source link

word frequency highlighting #35

Closed ckhordiasma closed 1 year ago

ckhordiasma commented 4 years ago

show words that are used multiple times

james-craven commented 1 year ago

@ckhordiasma Any luck implementing this? I actually came here to try to integrate it but I don't know react at all. I got it working in plain vanilla javascript but it's very messy and I'm not that great at clean optimal programming yet. It's hosted at james-craven.github.io/duplicates ... would love to see it integrated to the thesaurus though with a button that toggles the highlights on and off. Would make it so easy and simple to change out the duplicated words.

Edit: I've forked the repository and got it working...but it's ugly. Like I said, I'm not very familiar with react but I've been reading up on it the past few days. As of now, I have the highlighting function code in three separate places (1 place in BulletComparator, 2 places in BulletApp). I'm going to try to clean it up and refactor so that it's not repeated 3 times. Also want to add event listeners to the highlighted duplicates so that when they're clicked, they and their duplicates will highlight a different color to easily find them.

Last Edit: I've completed the feature at https://github.com/james-craven/pdf-bullets. I'm pretty sure there's a bit of unnecessary code though because I did a lot of trial and error with it. I'll submit a pull request and you can decide whether to merge it or clean it up. Either way this is completed.

ckhordiasma commented 1 year ago

sorry I completely did not see this question/comment until now haha. Your PR https://github.com/AF-VCD/pdf-bullets/pull/81 is merged now and the feature is on the main site now

overall great work and I really appreciate it.