Revision 39157
Added by Marek Horst over 8 years ago
DocumentToDocumentClassesActionBuilderModuleFactory.java | ||
---|---|---|
38 | 38 |
* @param predefinedTrust |
39 | 39 |
*/ |
40 | 40 |
public DocumentToDocumentClassesActionBuilderModule( |
41 |
String predefinedTrust) { |
|
42 |
super(predefinedTrust, algorithmName); |
|
41 |
String predefinedTrust, Float trustLevelThreshold) {
|
|
42 |
super(predefinedTrust, trustLevelThreshold, algorithmName);
|
|
43 | 43 |
} |
44 | 44 |
|
45 | 45 |
@Override |
... | ... | |
126 | 126 |
List<StructuredProperty> result = new ArrayList<StructuredProperty>(); |
127 | 127 |
for (eu.dnetlib.iis.documentsclassification.schemas.DocumentClass current : source) { |
128 | 128 |
if (current!=null) { |
129 |
result.add(convertAvroToProtoBuff(current, taxonomyName)); |
|
129 |
try { |
|
130 |
result.add(convertAvroToProtoBuff(current, taxonomyName)); |
|
131 |
} catch (TrustLevelThresholdExceededException e) { |
|
132 |
// no need to log, we just do not attach result |
|
133 |
} |
|
130 | 134 |
} |
131 | 135 |
} |
132 | 136 |
return result; |
... | ... | |
134 | 138 |
// |
135 | 139 |
private StructuredProperty convertAvroToProtoBuff( |
136 | 140 |
eu.dnetlib.iis.documentsclassification.schemas.DocumentClass source, |
137 |
String taxonomyName) { |
|
141 |
String taxonomyName) throws TrustLevelThresholdExceededException {
|
|
138 | 142 |
if (source!=null && source.getClassLabels()!=null && source.getClassLabels().size()>0) { |
139 | 143 |
StructuredProperty.Builder builder = StructuredProperty.newBuilder(); |
140 | 144 |
Qualifier.Builder qualifierBuilder = Qualifier.newBuilder(); |
... | ... | |
159 | 163 |
return null; |
160 | 164 |
} |
161 | 165 |
} |
162 |
|
|
163 |
@Override |
|
164 |
public AlgorithmName getAlgorithName() { |
|
165 |
return algorithmName; |
|
166 |
} |
|
167 | 166 |
} |
168 | 167 |
|
169 | 168 |
@Override |
170 | 169 |
public ActionBuilderModule<DocumentToDocumentClasses> instantiate( |
171 |
String predefinedTrust, Configuration config) { |
|
170 |
String predefinedTrust, Float trustLevelThreshold, Configuration config) {
|
|
172 | 171 |
return new DocumentToDocumentClassesActionBuilderModule( |
173 |
predefinedTrust); |
|
172 |
predefinedTrust, trustLevelThreshold);
|
|
174 | 173 |
} |
174 |
|
|
175 |
@Override |
|
176 |
public AlgorithmName getAlgorithName() { |
|
177 |
return algorithmName; |
|
178 |
} |
|
175 | 179 |
} |
Also available in: Unified diff
merging trunk changes with IIS-CDH-5.3.0 branch