Making life easier with Weka option handling

Anyone, who ever had to deal with Weka‘s option handling, knows that it is extremely error prone and cumbersome. The main reason is the separate handling of options through command-line and GUI. This results in duplicate text for options, different validation code (set method of property vs setOptions method). Also, any get/set method pair is considered an option in the GenericObjectEditor, however, the listOptions method might disagree with that. From my days as Weka maintainer, I knew that most bugs in classes were related to option handling. When I started development on ADAMS many years ago, I made sure that I wouldn’t do the same mistake. 🙂
Anyhow, long story short, since I still had to deal with Weka classes within ADAMS (custom filters and classifiers), I decided to make my life at least a bit easier. I created a helper class for making parsing and obtaining of options easy, weka.core.WekaOptionUtils was born! And now, a slightly modified version of that class is now available outside ADAMS:

Enjoy! 🙂