r/GoogleAppsScript • • 2d ago

Question Upload (large-ish) file for personal dictionary?

I have a text file that has (so far) about 5000 words in it that I would like Google Docs spell-check to ignore. (These are words in Old English/Anglo-Saxon, for which afaik there is no language pack available.) Obviously, it's impractical to try to add all of these words manually. I'm hoping — though I'm prepared to be disappointed, ha — to be able to bulk add/upload these words. Any ideas? Thx

1 Upvotes

6 comments sorted by

2

u/No-Sheepherder7116 2d ago

Short answer: unfortunately, no — there is no bulk import for this, and Apps Script can't do it either.

The personal dictionary is a per-account setting in Docs, and neither DocumentApp nor the Docs API exposes it. So a Sheet plus an Editor Add-on won't get you there — an add-on can read and write the document, but it has no way to add words to your personal dictionary.

What does work, depending on what matters most to you:

  1. If the red underlines are the main problem, turn off spelling suggestions in that document: Tools > Spelling and grammar, then uncheck Show spelling suggestions. The underlines go away, but you also lose spellchecking in that document, so it's a trade-off.
  2. If you only need a smaller set of words recognized, add them the manual way — right-click a flagged word and choose Add to dictionary, or go to Tools > Spelling and grammar > Personal dictionary and add them one at a time. It's slow for 5,000 words, but anything you do add is saved to your account and applies to your future documents too, not just that one.

For 5,000 Old English words, option 1 is the practical one. I know that's the disappointing answer you were braced for, but there is no supported upload, import file, or script for the personal dictionary.

1

u/Busy_Introduction_94 2d ago

Ok, thanks. My hope for this was to have spell check help reinforce correctness for someone writing in Old English, just as it does in modern English, modulo the ~5000 entries really only capture the 500 or so most common words and their inflections. Oh well! :)

0

u/nxl_boost_09 2d ago

Yes, it's possible. You can use a Google sheet to bulk upload the words and then use the App Script as an Editor Add-on.

1

u/Busy_Introduction_94 2d ago

Oh! Can you talk a bit more about what the add-on would do? Do you just mean using App Script as a way to automate the process of loading the words, or is there a way to use App Script as part of spell check? Thx!

1

u/nxl_boost_09 2d ago

Google Apps Script cannot access or bulk-import words into Google Docs' built-in personal dictionary, nor can it turn off the native checker.

The workaround is to disable Google Docs' built-in spell-check (Tools > Spelling and grammar > Show spelling suggestions) and build a simple custom spell-checker sidebar using Google Sheets + Google Apps Script.

How the Workaround Works (The Logic)

  1. Your Dictionary (Google Sheet): You create one Google Sheet with two tabs. Tab 1 (OldEnglish) holds your 5,000 Old English words in Column A. Tab 2 (ModernEnglish) holds a standard English dictionary list (you can download any free words_alpha.txt list online and paste it into Column A) so your script doesn't flag normal modern English words as typos.
  2. Speed Optimization (Caching): Reading a 100,000-word Google Sheet every time you run a check is slow. Instead, the script reads both tabs once, compresses the word lists into memory using Google's CacheService, and keeps them cached for 6 hours. Because CacheService has a 100 KB limit per entry, the Modern English list gets split into smaller chunks automatically.
  3. **Instant Checking (**Set Lookup): When you click "Check Spelling" in your Doc, the script grabs your document text, preserves Old English characters (þ, ð, æ, ƿ, ȝ, and macrons), and checks every word against the cached lists in milliseconds.
  4. The Sidebar: Unrecognized words appear in a sidebar in Google Docs. Clicking a word jumps straight to it in your text, or lets you click "Add to Dictionary" to append it to your OldEnglish Sheet tab and update the cache.

1

u/Busy_Introduction_94 2d ago

Fantastic, thanks for this. You're not kidding when you say that it builds a custom spell checker :)