السلام عليكم اخوتي الكرام
ارجو أن يقوم احد الخبراء بتوضيح طريقة استخدام النت بينز في استعمال أكواد جاهزة / لدي مشكلة في استخدام برنامج الوورد نت مع الجافا كما ساوضح فيما يلي:
I am trying to use Java API for WordNet Searching , JAWS to connect to WORDNET and I followed every step in the link
http://lyle.smu.edu/~tspell/jaws/
but nothing work
below are my codes and error
code
------
import edu.smu.tspell.wordnet.*;
/**
* Displays word forms and definitions for synsets containing the word form
* specified on the command line. To use this application, specify the word
* form that you wish to view synsets for, as in the following example which
* displays all synsets containing the word form "airplane":
* <br>
* java TestJAWS airplane
*/
public class TestJAWS
{
/**
* Main entry point. The command-line arguments are concatenated together
* (separated by spaces) and used as the word form to look up.
*/
public static void main(String[] args)
{
// String [] mine;
// mine = (test);
if (args.length > 0)
{
// Concatenate the command-line arguments
StringBuffer buffer = new StringBuffer();
System.setProperty("wordnet.database.dir", "C:/Program Files (x86)/WordNet/2.1/dic/");
for (int i = 0; i < args.length; i++)
{
buffer.append((i > 0 ? " " : "") + args);
}
String wordForm = buffer.toString();
// Get the synsets containing the wrod form
WordNetDatabase database = WordNetDatabase.getFileInstance();
Synset[] synsets = database.getSynsets(wordForm);
// Display the word forms and definitions for synsets retrieved
if (synsets.length > 0)
{
System.out.println("The following synsets contain '" +
wordForm + "' or a possible base form " +
"of that text:");
for (int i = 0; i < synsets.length; i++)
{
System.out.println("");
String[] wordForms = synsets.getWordForms();
for (int j = 0; j < wordForms.length; j++)
{
System.out.print((j > 0 ? ", " : "") +
wordForms[j]);
}
System.out.println(": " + synsets.getDefinition());
}
}
else
{
System.err.println("No synsets exist that contain " +
"the word form '" + wordForm + "'");
}
}
else
{
System.err.println("You must specify " +
"a word form for which to retrieve synsets.");
}
}
}
-----
error
java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Uncompilable source code - class TestJAWS is public, should be declared in a file named TestJAWS.java
at TestJAWS.<clinit>(Main.java:11)
Could not find the main class: TestJAWS. Program will exit.
Exception in thread "main" Java Result: 1