0% found this document useful (0 votes)
221 views11 pages

Java Report File

This document describes a document retrieval system project that allows users to search text documents. The project uses libraries like AWT, Swing, Java IO, and DOM4J to build the GUI and parse input files. The GUI contains components like JTextArea, JTextField, and JLabels. It allows the user to select an XML file to open, then searches the file text for keywords entered by the user. Matching words are highlighted in the displayed text. The conclusion states that the project allows parsing multiple files and searching for words, even similar ones. It implements the required functionality of selecting a file, extracting specific parts of XML data, and keyword searching within files.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
221 views11 pages

Java Report File

This document describes a document retrieval system project that allows users to search text documents. The project uses libraries like AWT, Swing, Java IO, and DOM4J to build the GUI and parse input files. The GUI contains components like JTextArea, JTextField, and JLabels. It allows the user to select an XML file to open, then searches the file text for keywords entered by the user. Matching words are highlighted in the displayed text. The conclusion states that the project allows parsing multiple files and searching for words, even similar ones. It implements the required functionality of selecting a file, extracting specific parts of XML data, and keyword searching within files.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 11

Cyprus International University

Institute Of Graduate Studies And Research


Department Of Information Systems Engineering

Advanced Programming Languages

Document Retrieval System

AbdulHaseeb Qadeer
ID: 21811224
Instructor: Assoc. Prof. Dr. Erbuğ ÇELEBİ

ISYE501

June 2020
The aim of this project (retrieval system) is, how to implement a simple UI that gets a search
keyword from the user and show the matching documents from title, data, and document body.
For achieving this aim, I build this project, this project included many functions and ways that I
want to explain it step by step.
Libraries: a library is a collection of precompiled routines that a program can use. The routines,
sometimes called modules, are stored in object format. Libraries are particularly useful for
storing frequently used routines because you do not need to explicitly link them to every
program that uses them. I want to mention some important libraries that I used.

I used all these libraries in my project, I want to


explain some of them:
I. Abstract Window Toolkit (AWT): is a set of application program interfaces ( API s)
used by Java programmers to create graphical user interface ( GUI ) objects, such as
buttons, scroll bars, and windows. AWT is part of the Java Foundation Classes from Sun
Microsystems, the company that originated Java.

II. Javax. Swing. Provides interfaces that enable the development of input methods that can
be used with any Java runtime environment. Provides a set of "lightweight" (all-Java
language) components that, to the maximum degree possible, work the same on all
platforms.

III. Java IO is an API that comes with Java, which is targeted at reading and writing data
(input and output). Most applications need to process some input and produce some
output based on that input. For instance, read data from a file or over network, and write
to a file or write a response back over the network.

IV. Org.w3c.Dom Description. Provides the interfaces for the Document Object Model


(DOM), which is a component API of the Java API for XML Processing.
V. XML Parser provides a way to access or modify data in
an XML document. Java provides multiple options to parse XML documents. ...
DOM4J Parser − A java library to parse XML, XPath, and XSLT
using Java Collections Framework.

After library, GUI part is starting, in this part I added some important component that I
needed.

VI. JTextArea to indicate the all text that I want from particular topics (Date, Topic and
Body) the size of this JTextArea will be 40*40.
VII. JTextField: This component allow the user to write something for searching. The length
of the characters that will be write 10 characters.
VIII. JLabel: I used this for Title of our project, and also JLabel indicate the user what action
you should do in different places.

For designing and visibility of our GUI, I implemented following steps.


IX. SetSize: it means, when we click run button, our output will shows in JFrame, which size
will be, in this project our output JFrame will be 1600*1200
X.  SetLayout (...) method allows you to set the layout of the container, often a JPanel, to
say FlowLayout, BorderLayout, GridLayout, null layout, or whatever layout desired. The
layout manager helps lay out the components held by this container.
XI. JFrame is a top-level container that provides a window on the screen. A frame is actually
a base window on which other components rely, namely the menu bar, panels, labels, text
fields, buttons, etc.
XII. SetVisible () - if you set it true, it means you want that thing to be visible in your screen.
And if you set it to false, you can't see anything in your screen.
XIII. SetResizable: allow the user to resize the JFrame, if you set it to false, you cannot
change the size, if you set it to true, it means you can change the JFrame size.

These are important components that I mentioned, relative to GUI.


Second part of the project is to read and parsing the particular file, for implementing this
concept, I used following way:

There are 21 Reuter’s files in the folder, this program allow the user to choose the file
which file do you want to open and user should write the file name such as (001 until
021).
If particular file exists, read the file, else not exists, I used try and catch Exception to inform the
user to correct the path of file.

After reading the file, it should get the name of nodes that included in the file, first read the
parent node, and after children Tags.
Each file has many children Tags, for recognizing, detecting and reading all children Tags I
preferred to use for loop.

For the each node type, I used for all of them (Date, Title and body) String TYPE, and for storing
this document I used EachSection ArrayList and I append it to JTextArea.
Third part of the project is how to find the word or phrases from entire document or whole text.
To achieving this aim, I implemented this way (I used 4 threads to search faster).
JTextField want from user to enter the word that he/she want, after input the word this
application will underline and highlight all words that similar with our input word, it means if I
input meet, it will underline and highlight for me all similar word like meets, meeting, meet,
etc…
For underlining the search text

For example, I want to search mon in the all document…it will find all phrases or words that it
has mon word... Monkey, many, money, among, month, piedmont, months, monetary, common,
Simon, Monday, etc…
Conclusion
This project that I build, it is very helpful and usable, through this project we can read and parse
many files from our PC, and storing from entire files just particular part (DATE, TITLE AND
BODY) of the file. In addition, give the user this ability to select one from 21 files and search for
favorable word from that particular file, and this software will not find just favorable word that
entered from user, but it will find all words that will be, even similar to our input word (for mon,
Monday, money, monkey, month, monetary, etc.).
In this project, I spent more time to build good and same project, as you want. I did my best,
Apart from some requirements; approximately, I implemented all requirements, which you want
from us in this project.

You might also like