public SuggestionGroup(AnnotationSuggestion... aItems) { suggestions = new ArrayList<>(asList(aItems)); sorted = suggestions.size() < 2; if (!suggestions.isEmpty()) { offset = suggestions.get(0).getOffset(); feature = get(0).getFeature(); layerId = get(0).getLayerId(); documentName = get(0).getDocumentName(); } }
/** * * @param aLayerId * @param aPredictions - list of sentences containing recommendations */ public void putPredictions(long aLayerId, List<AnnotationSuggestion> aPredictions) { aPredictions.forEach(prediction -> { if (prediction.getLabel() != null) { predictions.put(new ExtendedId(user.getUsername(), project.getId(), prediction.getDocumentName(), aLayerId, prediction.getOffset(), prediction.getRecommenderId(), prediction.getId(), -1), prediction); } }); }
offset = aSuggestion.getOffset(); feature = aSuggestion.getFeature(); layerId = aSuggestion.getLayerId();