git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngineExternalAlgorithms@71687 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
85b33bcba9
commit
6f335c73e3
|
@ -40,23 +40,28 @@ public class TaxaMatchTransducer extends StandardLocalExternalAlgorithm {
|
|||
|
||||
log("Computing matching for " + genus + " " + species);
|
||||
log("With operators: " + genusOperator + " " + speciesOperator);
|
||||
|
||||
func_Taxamatch func = new func_Taxamatch();
|
||||
AnalysisLogger.getLogger().trace("TaxaMatcher Initialized");
|
||||
String[] matches = func.func_Taxamatch(genus, species, genusOperator, speciesOperator, databaseIP, databaseUser, databasePwd, databaseName);
|
||||
|
||||
if ((matches == null) || (matches.length == 0)) {
|
||||
log("No match");
|
||||
if ((genus == null) || (species == null)) {
|
||||
log("Void input");
|
||||
addOutputString("Number of Matches", "0");
|
||||
} else {
|
||||
log("Found " + matches[0] + " matches");
|
||||
addOutputString("Number of Matches", matches[0]);
|
||||
String[] speciesn = matches[1].split("\n");
|
||||
for (int i = 0; i < speciesn.length; i++) {
|
||||
addOutputString("Match " + (i + 1), speciesn[i].trim());
|
||||
func_Taxamatch func = new func_Taxamatch();
|
||||
AnalysisLogger.getLogger().trace("TaxaMatcher Initialized");
|
||||
String[] matches = func.func_Taxamatch(genus, species, genusOperator, speciesOperator, databaseIP, databaseUser, databasePwd, databaseName);
|
||||
|
||||
if ((matches == null) || (matches.length == 0)) {
|
||||
log("No match");
|
||||
addOutputString("Number of Matches", "0");
|
||||
} else {
|
||||
log("Found " + matches[0] + " matches");
|
||||
addOutputString("Number of Matches", matches[0]);
|
||||
String[] speciesn = matches[1].split("\n");
|
||||
if (Integer.parseInt(matches[0]) > 0) {
|
||||
for (int i = 0; i < speciesn.length; i++) {
|
||||
addOutputString("Match " + (i + 1), speciesn[i].trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
log(outputParameters);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package org.gcube.dataanalysis.test;
|
|||
import java.util.List;
|
||||
|
||||
import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration;
|
||||
import org.gcube.dataanalysis.ecoengine.datatypes.StatisticalType;
|
||||
import org.gcube.dataanalysis.ecoengine.interfaces.ComputationalAgent;
|
||||
import org.gcube.dataanalysis.ecoengine.processing.factories.TransducerersFactory;
|
||||
import org.gcube.dataanalysis.ecoengine.test.regression.Regressor;
|
||||
|
@ -17,6 +18,7 @@ public static void main(String[] args) throws Exception {
|
|||
trans = TransducerersFactory.getTransducerers(testConfig());
|
||||
trans.get(0).init();
|
||||
Regressor.process(trans.get(0));
|
||||
StatisticalType st = trans.get(0).getOutput();
|
||||
trans = null;
|
||||
}
|
||||
|
||||
|
@ -25,7 +27,7 @@ public static void main(String[] args) throws Exception {
|
|||
AlgorithmConfiguration config = Regressor.getConfig();
|
||||
config.setAgent("FIN_TAXA_MATCH");
|
||||
config.setParam("Genus", "gadus");
|
||||
config.setParam("Species", "morhua");
|
||||
config.setParam("Species", "");
|
||||
|
||||
config.setParam("ComparisonOperatorforGenus", "EQUAL");
|
||||
config.setParam("ComparisonOperatorforSpecies", "EQUAL");
|
||||
|
|
Loading…
Reference in New Issue