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 4322110
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T08:49:54+00:00 2026-05-21T08:49:54+00:00

when user write a article, i wanna automatically generate tags from user writes base

  • 0

when user write a article, i wanna automatically generate tags from user writes base on a existing tag list.

for example, i got a list like:

Manhattan
Brooklyn
Queens
….

if user write a article which contains these key words, it will come to the tags.

like user have title :”Today i skated in Manhattan”, then Manhattan should be include tags.

i had considered foreach the tag list, but it is very slow if the tag list come to a big size.

Do you guys have any solutions to automatically generate tags? or have any idea to implement this problem ?

thanks in advance.

  • 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-21T08:49:55+00:00Added an answer on May 21, 2026 at 8:49 am

    Depending on the number of tags you have, a trie is likely to work well in this situation. With a trie, you build a tree data structure of the prefixes of your tags. For example, if you had tags like “A”, “to”, “tea”, “ted”, “ten”, “i”, “in”, and “inn” then you would build the following “prefix tree”:

    + - i - + i + - n - + in + - n - + inn +
      - A - + A +
      - t - + t + - o - + to +
                  - e - + te + - n - + ten +
                               - a - + tea +
                               - d - + ted +
    

    In this tree, the “- character -” indicates an edge and “+ string +” indicates a node. Once you’ve built this trie, I imagine the following algorithm:

    TrieNode root = rootOfTrie;
    TrieNode current = root;
    
    while (still typing)
    {
       switch (key pressed)
       {
          case letter:
    
             if (current == null)
                break;
    
             bool found = false;
    
             foreach (successor trie edge)
             {
                if (edge.Letter == letter)
                {
                   current = sucessor edge.node;
                   found = true;
                   break;
                }
             }
    
             if (!found)
                current = null;
    
             break;
    
          case whitespace:
    
             if (current != root && current != null && trie node is tag)
                suggest node current as tag;
    
             current = root;
             break;
    
          case backspace:
    
             // You may want to handle this case by back-tracking in the trie.
    
             current = null;
             break;
    
          default:
    
             current = null;
             break;
       }
    }
    

    Read more trie data structures at Wikipedia: http://en.wikipedia.org/wiki/Trie

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

Sidebar

Related Questions

I'm having an issue with article Tags where a user can write an article
so I need the user to write a review about an article or book
I am trying to write a Java applet that will read from a user's
From a July 2009 Technet article entitled Inside Windows 7 User Account Control ,
The requirement is that the user can write an article, therefore I choose type
Let the user write/draw a character on the canvas,and recognize it. Seems not so
Suppose I let the user to write a condition using Javascript, the user can
I need to test if a user can write to a folder before actually
Just as on StackOverflow, in my app a User can write Questions and can
Is it possible to write a user interface in Java for an application written

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.