Results 1 to 2 of 2
  1. #1
    squid_junior is offline Member
    Join Date
    Jun 2011
    Posts
    1
    Rep Power
    0

    Default Outlining a text/article using java

    Hi all,
    I want to create a program that can outline a text or article so that every subtopics can be viewed in a draft view.

    My idea on the activity flows of this program are :
    1. Open the file and read the text
    2. Read the text line by line
    2.1 If the line contains number and String text; capture and store it in database
    2.2 capture and store the content of the subtopic in database
    2.3 Else; back to 2
    3.End

    As i mentioned above, I'm using a combination of number and text to indicate that this is a subtopic title in the program's eyes. Though, i don't think that this is a wise algorithm as miscalculation would happened here.

    For example:
    Let say we have a part of an article with :

    2.0 Why Java?
    There are some major reason that bla..bla..bla... as follow :
    1. Java is easy
    2. Java is understandable

    What I'm trying to show here is if there exist an ordered list inside a subtopic, the program will see it as a subtopic title too...not an ordered list...and this is troublesome...

    So, What kind of algorithm should I use to solve this problem?
    If there are any, can you explain to me step-by-step as I'm new to Java.
    Plus, I also need help on the programming code as well. I want to know about the class and functions/methods I should use to build this program.
    Any good suggestions and explaination are kindly appreciated.

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default

    It seems to me that the elements of the ordered list *are* - in a certain sense - subtopics.

    For instance a similar example to the one you gave could be

    2.0 Why Java?
    There are some major reason that bla..bla..bla... as follow :
    1. Java is easy
    A paragraph describing Java's ease of use goes here.
    And another.
    2. Java is understandable
    A paragraph describing the understandability of Java goes here.
    And another.
    In this case you probably want to recognise points 1 and 2 in your outline (as subpoints of 2.0). The difference is one of length: where all the "sibling" sections are less than a certain size then you could choose not to recognise them as distinct subsections.

    One way of handling this would be to store all of the sections however small in the database. Then in a second step go through the "tree" that is your outline and collapse the nodes whose children are all small.

Similar Threads

  1. Replies: 0
    Last Post: 12-09-2010, 06:56 PM
  2. New article about ZK the pure Java RIA framework
    By simbo in forum Web Frameworks
    Replies: 0
    Last Post: 03-13-2009, 09:27 AM
  3. Binary Search searching news Article
    By peterdfl in forum New To Java
    Replies: 0
    Last Post: 09-26-2008, 12:57 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •