From 4f04854cc962f1d1ba970ab6bc16e18d0aeb43be Mon Sep 17 00:00:00 2001 From: Torben <59419684+entorb@users.noreply.github.com> Date: Sun, 19 Mar 2023 12:45:31 +0100 Subject: [PATCH] cspell remove unused words --- cspell-words.txt | 454 +++++----------------------- scripts/cspell-find-unused-words.py | 48 +++ 2 files changed, 116 insertions(+), 386 deletions(-) create mode 100755 scripts/cspell-find-unused-words.py diff --git a/cspell-words.txt b/cspell-words.txt index 2b4261377..2ecd714e6 100644 --- a/cspell-words.txt +++ b/cspell-words.txt @@ -1,233 +1,137 @@ -# Custom Dictionary Words -# from EN spelling-list.txt -# + some manually added ones Aberforth -Aberforth’s Accio Acromantula Acromantulas adamantium -æons -afterburn Aguamenti Alastor -Alastor’s +Alastors Albus -Albus’s Alecto -alicorn Alicorn -alicorn’s -alienness Alissa -Alissa’s +Alissas Alohomora Amycus -angsty Animagi Animagus Apparate -Apparated -Apparating Aragorn -arguendo -Argus’s -Arithmancy Arsenius Asch -Asch’s -Ashwinder -Ashwinders +Aschs Astorga -Astorga’s -Atlanteans +Astorgas Auror -Auror’s Aurors -auspisticing Avada Azathoth -Azkaban -Azkaban’s -Azkabans Baba Baconian -Bafflesnaffle -Baggins Balrogs Bartemius -Bartemy -Batman’s -Bayes’s -bearability +Batmans Beauxbatons -Beauxbatons’s Belka -Belka’s +Belkas Bellatrix -Bellatrix’s -Bester’s +Bellatrixs +Besters Bilbo -Bilbo’s +Bilbos Binns -bint -Black’s -Blaise’s -blockable +Blacks Blondlot -Blondlot’s +Blondlots Blotts -Bludger -Bludgers -bodilessly -boggart -boggart’s -bogies -Bones’s Boromir Bree Brocklehurst Brodski Bulstrode Butnaru -Butnaru’s -buzzings -Cadmus’s +Butnarus Calvaria -capper Carrow -Carrow’s -centeredness cetera -Chang’s -Chaotics -chipper -Chloe’s +Changs Cho Chudley -Cialdini’s -Clearwater’s -clingings +Cialdinis +Clearwaters Cluthe Colloportus Comed compatibilist Confund -Confunded -Confunding confundio Confundus -consequentialism Contego -Contegos Coote Cornelion Cornfoot -Cornfoot’s -cosying -counterstroke +Cornfoots Crabbes -crikey -Critch’s -crossguard -Crouch’s +Critchs +Crouchs Cruciatus Crucio -Crucioed Cthulhu -curvily -Danegeld -Daphne’s -Darley’s +Daphnes Darth -deasil Deligitor Dementation Dementor -Dementor’s Dementors Densaugeo der -deus -Diagon Diffindo -Diffindos Diggory Diracawl Diricawl -DMLE Dobby -dodgeball -domitable -drabs Draco -Draco’s Dracos -drayage Drexler -dribs -duddy Dumbledore -Dumbledore’s Dumbledores Durmstrang Dursley Eliezer Elrond -emeraldine Emmeline -Emmeline’s -emotionlessly -emotionlessness -emplaced +Emmelines Entwhistle -Entwhistle’s +Entwhistles Erdős erectus -Ernie’s +Ernies Escher -Evans’s Everto Expecto Expelliarmus -faceful -fallbacks fanfic -fanfics fanfiction -fasces -Fawkes’s Felthorne -Felthorne’s +Felthornes Feynman -Fiendfyre Figg -Filch’s +Filchs Filius Finnigan Firenze -Firewhiskey Flamel -Flamel’s +Flamels Fletchley -Fletchley’s +Fletchleys Flitwick -Flitwick’s -Flobberworms -Floo -Floo’s -Flooed +Flitwicks Flubber Flubberwalt -foretellings Frigideiro -fuddy -fullerene -furcot Gawain Ghostbusters Gilderoy -Gillyweed Gimli Ginevra Ginny @@ -235,460 +139,238 @@ Gladius Glisseo Glóin Glorfindel -Glowpox -Gobstones Godric -Godric’s -golems +Godrics Gollum Goryanof -Goryanof’s +Goryanofs Goyle -Goyle’s Goyles grad -Granger’s Grangers Greengrass -Greengrass’s Greengrasses -Gregory’s +Gregorys Grinch Grindelwald -Grindelwald’s +Grindelwalds Grindie -Grindie’s -grindylows Gringotts Griphook -Griphook’s +Griphooks Gryffindor -Gryffindor’s Gryffindors Hagrid -Hagrid’s -Hallow’s -happenstance -Harry’d -healings -hedonic -hedonics +Hagrids +Hallows Helga -Herbology -Hermione -Hermione’s -Hermiones -heroing Hestia hm -hobbyhorse Hogsmeade Hogwarts -Hogwarts’s hols Hooch -horcrux -horcruxed -horcruxes -how’ll +hpmor Hufflepuff -Hufflepuff’s Hufflepuffs -Humean -huzzah Ignotus Imperio Imperius -Imperiused -Imperiuses -Imperviused Incantatem -Incantato Incendio Incendium -incongruent -incuriosity -indomitability Inferi Inferius Inflammare Isildur -Isildur’s +Isildurs Jugson -Jugson’s -Justin’s +Jugsons +Justins Katarina -Kazuma’s +Kazumas Kedavra Kinnison -knobbed -knockdown Knut Knuts Komodo -Komodo’s Krait Lagann -Latané Leanne -learnable -Legilimency Legilimens -Legilimize -Legilimized -Legilimizing Legolas Lehrer Lesath -Lesath’s +Lesaths Lestrange -Lestrange’s Lestranges Lethifold Lethifolds -level’s Leviosa -liberated lich -lich’s -lightless +lichs Lilys -Lived’s Longbottom -Longbottom’s Longbottoms Lovegood -Lovegood’s +Lovegoods Lucis -Lucius’s Luminos Lumos -Lupin’s +Lupins MacDougal machina Macnair Magica -magicless -magics -magisterium Malfoy -Malfoy’s Malfoys Malkin -Malkin’s -maned -manœuvre -Mao’s +Malkins +Maos Maximus McGonagall -McGonagall’s McGonagalls -Mendelian -merfolk -merman Metamorphmagi Metamorphmagus Milgram -Milgram’s +Milgrams Millicent -Millicent’s +Millicents Minas -Minerva’s -minutiæ +Minervas Mohandas -moirail Moke -mokeskin -Monroe’s +Monroes Montagues Morag Mordor -mothership -mudblood -mudblood’s -mudbloods -Muggle -Muggleborn -Muggleborns -Muggles Mugwump Mugwumps -Mum’d Mundungus -Mungo’s -murderess’s -nanofactory +Mungos Narcissa -negentropy -Newcomb’s -NEWTs +Newcombs nihil -not’ve Nott Nullus -Numbcloth Númenor Nurmengard Nymphadora Obliviate -Obliviated -Obliviating -Obliviation -Obliviations -Obliviators Occlumency -Occlumens Oculum -offed offs -okane olds Ollivander -Ollivander’s +Ollivanders omake -Omnioculars -ophidarium -ossifrage -Outstandings -owled owling -OWLs Padma -Padma’s Padmas -pæan -paperclip Parkinsons -Parselmouth -Parselmouths -Parseltongue Parvati -Parvati’s +Parvatis Patil -Patil’s Patronum Patronus -Patronuses -Pavlovian Penrose -Pensieve Percival Perenelle -Perenelle’s +Perenelles Pettigrew -Pettigrew’s +Pettigrews Peverell -Peverell’s -phœnix -phœnix’s -pillock +Peverells Polaris Polyfluis -Polyjuice -Polyjuiced -Polyjuicing -polymorph Pomfrey -Pomfrey’s -portkey -portkey’s -portkeyed -portkeying -portkeys -pranking +Pomfreys Pratchett -priors Prismatis -Procopius prodi -projectivism Protego -pureblood -purebloods QED -Quaffle Quidditch Quirinus -Quirinus’s Quirrell -Quirrell’s +Quirrells Rabastan -Rabastan’s +Rabastans Rabi -raters Ravenclaw -Ravenclaw’s Ravenclaws Ravum -rediscoverer Reducto Regulus -rejoinder -relative’s -Remembrall Remus -Remus’s -reputational -retargeting revelio Reverso Rianne -ribosomes -rictus Robards -rooftop’s Rowling -Rowling’s +Rowlings Rubeus -s’pose -saddos Sagitta -Samwise sapiens Sauron -savviness -Schelling Scourgify Scrimgeour -scriptum -scrying se -self’s Severus -Severus’s Shacklebolt shalt Silencio -Silvanus Sinistra -Sinistra’s Skeeter -skeptical -skeptically -skepticism -slippable Sloper Slytherin -Slytherin’s Slytherins -Smullyan -snakish Snape -Snape’s +Snapes Somnium Sonorus -sourceless -spasmed -spell’s Spimster -splendoured -Sprout’s -strangelets -strawman +Sprouts Stuporfy -substanceless Sunnies Supergirl -supermajority supernum -susurration Sybill -synchronies Szilard Tacticus taser -teleported -Tetlock’s +Tetlocks Théoden -there’re Thestral -Thestrals -thingy Tirith Tonare Tonks Trelawney -Trelawney’s -trickable -tripsigns -troublingly -twere +Trelawneys Twix Umbridge -unaged -unanchored -unblockable -unbraced -unbreakability -uncaringly -uncastable -uncushioned -undead -unenchanted -unfocusing -unforgiveable -unfound -unguessable -unidentifiability -unitarity -unregenerating -unseeable -unseeably -Unspeakables -unwarmed -unworkability -Vanishment Veela Ventriliquo Ventus Veritas Veritaserum Verres -Verres’s -Vinge’s Voldemort -Voldemort’s Voldemorts Voldie -Voldie’s +Voldies Waals -waifish -wandless -wandlessly -wandwork Weasley -Weasley’s Weasleys -Weathertop ween -What’ll -what’ve -whatever’s -whickering -whoever’d -why’d -why’re -why’s -wibble Wibble -Wibble’s -widdershins +Wibbles Wingardium -witchy -wizardborn -wizardborns -wizarding -wizardkind -wizardkind’s -Wizengamot -Wizengamot’s Wulfric Yaga -Yaga’s +Yagas Yermy -younglings Yudkowsky Zabini -Zabini’d -Zabini’s +Zabinis Zaubergamot diff --git a/scripts/cspell-find-unused-words.py b/scripts/cspell-find-unused-words.py new file mode 100755 index 000000000..71f8afc14 --- /dev/null +++ b/scripts/cspell-find-unused-words.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 +# by Torben Menke https://entorb.net +""" +Remove unused words from cspell wordlist. + +reads wordlist +reads chapter LaTeX files, removes comments +""" + +import re +from pathlib import Path + +path_to_wordlist = Path("cspell-words.txt") +words = path_to_wordlist.read_text(encoding="utf-8").splitlines() + +# remove duplicates in source file +words = set(words) +words = sorted(words, key=lambda x: x.lower()) +# path_to_wordlist.write_text("\n".join(words)) + +cont_all_chapter: str = "" +for chapter_file in sorted(Path("chapters").glob("*.tex")): + cont_all_chapter += chapter_file.read_text(encoding="utf-8") + +# remove comments +cont_all_chapter = re.sub(r"(?