Results 1 to 2 of 2
- 06-27-2011, 05:29 AM #1
Member
- Join Date
- Jun 2011
- Posts
- 1
- Rep Power
- 0
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 database2.2 capture and store the content of the subtopic in database2.3 Else; back to 23.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.
- 06-27-2011, 05:50 AM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,547
- Rep Power
- 11
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
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.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.
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
-
Applet program to open a text file and display the content in text area
By bitse in forum Java AppletsReplies: 0Last Post: 12-09-2010, 05:56 PM -
New article about ZK the pure Java RIA framework
By simbo in forum Web FrameworksReplies: 0Last Post: 03-13-2009, 08:27 AM -
Binary Search searching news Article
By peterdfl in forum New To JavaReplies: 0Last Post: 09-25-2008, 11:57 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks