From: <jen...@us...> - 2007-09-22 10:22:02
|
Revision: 148 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=148&view=rev Author: jenslehmann Date: 2007-09-22 03:22:00 -0700 (Sat, 22 Sep 2007) Log Message: ----------- added string config options and new learning problem structure Added Paths: ----------- trunk/src/dl-learner/org/dllearner/core/CommonConfigOptions.java trunk/src/dl-learner/org/dllearner/core/StringConfigOption.java trunk/src/dl-learner/org/dllearner/learningproblems/ trunk/src/dl-learner/org/dllearner/learningproblems/DefinitionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/DefinitionLPThreeValued.java trunk/src/dl-learner/org/dllearner/learningproblems/DefinitionLPTwoValued.java trunk/src/dl-learner/org/dllearner/learningproblems/LearningProblemNew.java Added: trunk/src/dl-learner/org/dllearner/core/CommonConfigOptions.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/CommonConfigOptions.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/CommonConfigOptions.java 2007-09-22 10:22:00 UTC (rev 148) @@ -0,0 +1,34 @@ +/** + * Copyright (C) 2007, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.core; + +/** + * @author Jens Lehmann + * + */ +public final class CommonConfigOptions { + + public static final IntegerConfigOption getVerbosityOption() { + // TODO: temporary code + IntegerConfigOption verbosityOption = new IntegerConfigOption("verbosity"); + return verbosityOption; + } + +} Added: trunk/src/dl-learner/org/dllearner/core/StringConfigOption.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/StringConfigOption.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/StringConfigOption.java 2007-09-22 10:22:00 UTC (rev 148) @@ -0,0 +1,71 @@ +/** + * Copyright (C) 2007, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.core; + +import java.util.Set; +import java.util.TreeSet; + +/** + * A configuration option, which allows values of type String. Optionally a set + * of allowed strings can be set. By default all strings are allowed. + * + * @author Jens Lehmann + * + */ +public class StringConfigOption extends ConfigOption { + + private Set<String> allowedValues; + + public StringConfigOption(String name) { + super(name); + allowedValues = new TreeSet<String>(); + } + + /* (non-Javadoc) + * @see org.dllearner.core.ConfigOption#isValidValue(java.lang.Object) + */ + @Override + public boolean isValidValue(Object value) { + if(!(value instanceof String)) + return false; + + String stringValue = (String) value; + + if(allowedValues.size() == 0 || allowedValues.contains(stringValue)) + return true; + else + return false; + } + + /** + * @return the allowedValues + */ + public Set<String> getAllowedValues() { + return allowedValues; + } + + /** + * @param allowedValues the allowedValues to set + */ + public void setAllowedValues(Set<String> allowedValues) { + this.allowedValues = allowedValues; + } + +} Added: trunk/src/dl-learner/org/dllearner/learningproblems/DefinitionLP.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/DefinitionLP.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/learningproblems/DefinitionLP.java 2007-09-22 10:22:00 UTC (rev 148) @@ -0,0 +1,58 @@ +/** + * Copyright (C) 2007, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.learningproblems; + +import java.util.Collection; + +import org.dllearner.core.Component; +import org.dllearner.core.ConfigEntry; +import org.dllearner.core.ConfigOption; + +/** + * @author Jens Lehmann + * + */ +public abstract class DefinitionLP implements LearningProblemNew, Component { + + /* (non-Javadoc) + * @see org.dllearner.core.Component#applyConfigEntry(org.dllearner.core.ConfigEntry) + */ + public void applyConfigEntry(ConfigEntry entry) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.Component#getConfigOptions() + */ + public Collection<ConfigOption> getConfigOptions() { + // TODO Auto-generated method stub + return null; + } + + /* (non-Javadoc) + * @see org.dllearner.core.Component#getName() + */ + public String getName() { + // TODO Auto-generated method stub + return null; + } + +} Added: trunk/src/dl-learner/org/dllearner/learningproblems/DefinitionLPThreeValued.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/DefinitionLPThreeValued.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/learningproblems/DefinitionLPThreeValued.java 2007-09-22 10:22:00 UTC (rev 148) @@ -0,0 +1,35 @@ +/** + * Copyright (C) 2007, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.learningproblems; + +import java.util.Collection; + +import org.dllearner.core.ConfigEntry; +import org.dllearner.core.ConfigOption; + +/** + * @author Jens Lehmann + * + */ +public class DefinitionLPThreeValued extends DefinitionLP { + + + +} Added: trunk/src/dl-learner/org/dllearner/learningproblems/DefinitionLPTwoValued.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/DefinitionLPTwoValued.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/learningproblems/DefinitionLPTwoValued.java 2007-09-22 10:22:00 UTC (rev 148) @@ -0,0 +1,30 @@ +/** + * Copyright (C) 2007, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.learningproblems; + +/** + * @author Jens Lehmann + * + */ +public class DefinitionLPTwoValued extends DefinitionLP { + + + +} Added: trunk/src/dl-learner/org/dllearner/learningproblems/LearningProblemNew.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/LearningProblemNew.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/learningproblems/LearningProblemNew.java 2007-09-22 10:22:00 UTC (rev 148) @@ -0,0 +1,31 @@ +/** + * Copyright (C) 2007, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.learningproblems; + +/** + * Marker interface for all learning problems (the "New" at the end of the name + * is temporary for the restructuring process). + * + * @author Jens Lehmann + * + */ +public interface LearningProblemNew { + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |