Monday, July 2, 2012

How to use use AllJavadoc class from Weka

Weka framework has a useful tool to generate Javadoc for your classes. It uses information that you provided in the sources to generate appropriate Javadoc automatically. This helps to update Javadoc when you update sources.

Under the cut I'll describe how to use this tool.

When you want to write a new classifier for Weka, it is good to think about the documentation in front. To do this, you need to add the following JavaDoc in front of your class definition:

TechnicalInformationHandler interface have only one method that returns bibliographic information. You may need to implement this interface to provide source where algorithm you implement was described. Here is an example of implementation of this method:


Another source of information for JavaDoc generation is implementation of listOptions() method. In this method you should provide information about all options supported by your classifier:


The last thing you need to do is to add the following JavaDoc to your setOptions() method:

The only thing that is left is to generate JavaDoc for your class. Add it to Weka sources and build Weka with:

Now go to directory /dist directory where weka jar can be found:


Now you need to run AllJavadoc tool with the following command:


or in my case:


Now you should see your class with generated JavaDoc.
-dir parameter specifies path to Weka sources
-W parameter specifies canonical name of the class for which you are want to generate JavaDoc.

That's all.
Good luck.

No comments:

Post a Comment