Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1003803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:01:59+00:00 2026-05-16T08:01:59+00:00

Surprisingly I’ve been unable to find anyone else really doing this, but surely someone

  • 0

Surprisingly I’ve been unable to find anyone else really doing this, but surely someone has. I’m working on a python project currently that involves spell checking some 16 thousand words. That number of words is only going to grow unfortunately. Right now I’m pulling words from Mongo, iterating through them, and then spell checking them with pyenchant. I’ve removed mongo as the potential bottleneck by grabbing all my items from there first. That leaves me with around 20 minutes to process through 16k words, which is obviously longer than I want to spend. This leaves me with a couple ideas/questions:

  1. Obviously I could leverage threading or some form of parallelism. Even if I chop this into 4 pieces, I’m still looking at roughly 5 minutes assuming peak performance.

  2. Is there a way to tell what spelling library Enchant is using underneath pyenchant? Enchant’s website seems to imply it’ll use all available spelling libraries/dictionaries when spell checking. If so, then I’m potentially running each word through three-four spelling dicts. This could be my issue right here, but I’m having a hard time proving that’s the case. Even if it is, is my option really to uninstall other libraries? Sounds unfortunate.

So, any ideas on how I can squeeze at least a bit more performance out of this? I’m fine with chopping this into parallel tasks, but I’d still like to get the core piece of it to be a bit faster before I do.

Edit: Sorry, posting before morning coffee… Enchant generates a list of suggestions for me if a word is incorrectly spelled. That would appear to be where I spend most of my time in this processing portion.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T08:01:59+00:00Added an answer on May 16, 2026 at 8:01 am

    I think we agree that the performance bottleneck here is Enchant; for this size of dataset it’s nearly instantaneous to do a boolean isSpeltCorrectly. So, why not:

    1. Build a set in memory of correctly-spelt words, using the dictionaries that Enchant does or fetching your own (e.g. OpenOffice’s).

      Optionally, uniquify the document’s words, say by putting them in a set. This probably won’t save you very much.

    2. Check whether each word is in the set or not. This is fast, because it’s just a set lookup. (Probably O(log N) where N is the number of words? assuming set buckets by hash and does a binary search… a Python guru can correct me here.)

    3. If it isn’t, then ask Enchant to recommend a word for it. This is necessarily slow.

    This assumes that most of your words are spelt correctly; if they aren’t, you’ll have to be cleverer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It must be simple, but surprisingly I couldn't find an answer to this problem
Surprisingly I was only able to find one previous question on SO about this
I'm sure there are a million posts about this out there, but surprisingly I'm
Microsoft has provided surprisingly small amounts of information regarding this issue or I do
I can find tons of general purpose documentation on Boost.Build, but surprisingly nothing on
I've just started developing for Android. So far it's been surprisingly smooth sailing, but
Surprisingly enough I couldn't find the answer to this question. I am trying to
This is likely a a novice question, but google surprisingly did not provide an
It's surprising how difficult it is to find a simple, concise answer to this
Surprisingly, I couldn't find a first step guide on how to setup Selenium WebDriver

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.