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

  • SEARCH
  • Home
  • 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 3421474
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:06:31+00:00 2026-05-18T06:06:31+00:00

I have a huge list of multi-byte sequences (lets call them words) that I

  • 0

I have a huge list of multi-byte sequences (lets call them words) that I need to store in a file and that I need to be able to lookup quickly. Huge means: About 2 million of those, each 10-20 bytes in length.

Furthermore, each word shall have a tag value associated with it, so that I can use that to reference more (external) data for each item (hence, a spellchecker’s dictionary is not working here as that only provides a hit-test).

If this were just in memory, and if memory was plenty, I could simply store all words in a hashed map (aka dictionary, aka key-value pairs), or in a sorted list for a binary search.

However, I’d like to compress the data highly, and would also prefer not to have to read the data into memory but rather search inside the file.

As the words are mostly based on the english language, there’s a certain likelyness that certain “sillables” in the words occur more often than others – which is probably helpful for an efficient algorithm.

Can someone point me to an efficient technique or algorithm for this?

Or even code examples?

Update

I figure that DAWG or anything similar routes the path into common suffixes this way won’t work for me, because then I won’t be able to tag each complete word path with an individual value. If I were to detect common suffixes, I’d have to put them into their own dictionary (lookup table) so that a trie node could reference them, yet the node would keep its own ending node for storing that path’s tag value.

In fact, that’s probably the way to go:

Instead of building the tree nodes for single chars only, I could try to find often-used character sequences, and make a node for those as well. That way, single nodes can cover multiple chars, maybe leading to better compression.

Now, if that’s viable, how would I actually find often-used sub-sequences in all my phrases?
With about 2 million phrases consisting of usually 1-3 words, it’ll be tough to run all permutations of all possible substrings…

  • 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-18T06:06:32+00:00Added an answer on May 18, 2026 at 6:06 am

    There exists a data structure called a trie. I believe that this data structure is perfectly suited for your requirements. Basically a trie is a tree where each node is a letter and each node has child nodes. In an letter based trie, there would be 26 children per node.

    Depending on what language you are using this may be easier or better to store as a variable length list while creation.

    This structure gives:
    a) Fast searching. Following a word of length n, you can find the string in n links in the tree.
    b) Compression. Common prefixes are stored.

    Example: The word BANANA and BANAL both will have B,A,N,A nodes equal and then the last (A) node will have 2 children, L and N. Your Nodes can also stored other information about the word.

    (http://en.wikipedia.org/wiki/Trie)

    Andrew JS

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

Sidebar

Related Questions

I have huge list (200000) of strings (multi word). I want to group these
I have a persistent object that has a huge list of child elements. I'm
I have a long list of words that I want to remove from my
I have two files. File A has a list of words, one on each
What to do here? I have a huge list of files that Google Speed
I have a Gridview that displays a huge list of products. On Client click
I have a huge list of URLs and my task is to feed them
I have a huge list of video files from a webcam that have that
I have a huge list of stores name in (.doc) file and I want
I have a huge CSV list that needs to be broken up into smaller

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.