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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:21:02+00:00 2026-05-26T21:21:02+00:00

I’m trying to find a more or less foolproof way to solve the following

  • 0

I’m trying to find a more or less foolproof way to solve the following problem, and would be grateful if any of you can suggest a better way of doing the following.

My application is handling text that comes from a file and can be of unlimited length (in my current example I have 8,000 words in a text file). For a new project the text (String) is loaded, tokenized (words), the tokens written to a graph model and displayed in a JTable (where they can be tagged). The graph can be saved to XML (and must be, should the project be made loadable).

The table consists of 3 rows (token index, token text, tag).

The problem is, the process of writing each token to the graph model takes a long time (~7 min. for 8,000 wds.). Thus I need to display the JTable before this writing process is completed and make it available for tagging. Not a big problem: Since the actual tokenization (clean & split String) is fast, I can display the table based on the String rather than filling it from the graph model (for tokens and tags).

The problem is rather, that a) the writing-to-graph process must be finished before the model can be saved, and b) that I need to write tags to the model for tokens that might not exist yet (when the user is quicker than the application/the writing process for tokens, e.g. when s/he chooses a tag for the last of a large no. of words while the writing process has only just started). So I want to be able to check the table for newly set tags as soon as possible after the tagging action, check the graph whether the token for the tag exists yet, write the tag if it does, and re-check later if it doesn’t.

Here’s a prose outline of how I thought it could be done, and I’d be grateful if you had a look at it and let me know whether you see opportunity for optimization and/or bland errors. Would save me a lot of time and re-factoring later.

Thanks a lot!

Preparation

  1. Load text from file
  2. Clean and split text into tokens
  3. Display table based on cleaned and split text
  4. Start process of writing tokens to graph (Thread) + update int (e.g., int lastWritten) with index of last token written

Tagging action by user

  1. Check if token to be tagged exists in graph (via lastWritten)
    • Yes: Write tag to graph, display tag in table
    • No: Save index of token in a list (e.g., taggedTokenNotWritten), display tag in table
      • Start new Thread that checks whether tokens in taggedTokenNotWritten have been written yet. If so – write tag to token + delete from list; if not – keep in list. Run Thread periodically (e.g., whenever a tag is set*?*).

Save action by user

  1. Check whether tokenization process is finished + check whether taggedTokenNotWritten is empty.
    • If yes – save; if no – display message & save only after the above applies.
  • 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-26T21:21:02+00:00Added an answer on May 26, 2026 at 9:21 pm

    You might be able to leverage this example that uses a SwingWorker to asynchronously process a BlockingQueue of pending entries in its background thread.

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

Sidebar

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
In my XML file chapters tag has more chapter tag.i need to display chapters
I would like to run a str_replace or preg_replace which looks for certain words

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.