|
-
Problem with using Vector
There is a text file named 'stoplist' containing a list of words, like this:
a
the
they
we
be
is
...
What I wanna do is to store them in a Vector. I've got the following code:
Vector stopList = new Vector();
File stoplist = new File("C:\\Text_Preprocessing\\stoplist.txt");
FileReader stopword = new FileReader(stoplist);
int s = stopword.read();
while (s != -1) {
StringBuffer StopString = new StringBuffer();
if (s!='\n') StopString.append((char)s);
else stopList.addElement(StopString.toString());
}
stopword.close();
However, it can not be run! Where is the problem?
Similar Threads
-
Replies: 5
Last Post: 02-23-2005, 12:13 AM
-
Replies: 0
Last Post: 10-30-2002, 04:40 AM
-
Replies: 1
Last Post: 02-23-2002, 01:44 AM
-
Replies: 0
Last Post: 12-13-2001, 12:06 PM
-
Replies: 1
Last Post: 11-05-2000, 08:34 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks