@Override public boolean contains(Object o) { return realSet.contains(o); }
@Override public Set<ExtendedNode> getInvolvedNodesInTree() { return getMapLhsToTree().rightSet().getMutableSetCopy(); }
@Override public ImmutableIterator<T> iterator() { return new ImmutableIteratorSubTypeWrapper<T,U>(realSet.iterator()); }
if (Constants.DIRT_LIKE_QUERY_RULE_ALSO_BY_HYPOTHESIS_TEMPLATES) notYetHyothesisTemplates = hypothesisTemplates.getMutableSetCopy(); if (Constants.DIRT_LIKE_FILTER_BY_HYPOTHESIS_TEMPLATES) if (!hypothesisTemplates.contains(templateAndScore.getTemplate()))
@Override public int size() { return realSet.size(); }
@Override public boolean isEmpty() { return realSet.isEmpty(); }
@Override public boolean containsAll(Collection<?> c) { return realSet.containsAll(c); }
public static <I,T extends AbstractNode<I,T>> void removeNestedTags(TreeCoreferenceInformation<T> information) throws TreeCoreferenceInformationException { ImmutableSet<Integer> allGroupIds = information.getAllExistingGroupIds(); for (Integer id : allGroupIds) { ImmutableSet<T> nodes = information.getGroup(id).getImmutableSetCopy(); for (T node : nodes) { for (T nestedNode : TreeIterator.iterableTree(node)) { if (nestedNode==node) ; else { if (information.isNodeExist(nestedNode)) { if (information.getIdOf(nestedNode).equals(id)) information.remove(nestedNode); } } } } } }
public static boolean notEmpty(ImmutableSet<?> set) { boolean ret = false; if (set!=null) if (set.size()>0) ret = true; return ret; }
if (fromWhich.size()!=1) exception = new TeEngineMlException("Wrong mapping. fromWhich.size() = "+fromWhich.size()+ "\nIt seems that mapOriginalToGenerated, which is actually given from some subclass of GenerationOperation" + "was build incorrectly. It cannot happen that a generated node was build from two different nodes." + else ExtendedNode nodeFromWhich = fromWhich.iterator().next(); OriginalInfoTrace originalInfoTrace = ExtendedInfoGetFields.getOriginalInfoTrace(nodeFromWhich.getInfo()); if (originalInfoTrace!=null)
(extractionTypes.isEmpty()) ||
@Override public boolean containsAll(ImmutableCollection<?> c) { return realSet.containsAll(c); }
/** * return true iff this {@link StanfordDepedencyRelationType} is a valid relation between a factive predicate and its arg. * @param relation * @return */ public boolean isFactiveRelation(StanfordDepedencyRelationType relation) { if (!ComplementRelations.COMPLEMENT_RELATIONS.contains(relation)) return false; // the relation isn't argumental. factivity is impossible. switch (this) { case P_P: return true; case P_P_FinP: case P_P_FinP_P_N_InfP: case P_P_FinP_N_P_InfP: case P_P_FinP_P_U_InfP: case P_P_FinP_N_U_InfP: return !ComplementRelations.NON_FINITE_RELATIONS.contains(relation); default: // non factive signature return false; } }
@Override public T[] toArray(T[] a) { @SuppressWarnings("unchecked") T[] ret = (T[]) java.lang.reflect.Array.newInstance(a.getClass().getComponentType(), realSet.size()); int index=0; for (T t : realSet) { ret[index] = t; ++index; } return ret; }
/** * Assuming this is called from the Swing thread (I.e. in the context of {@link javax.swing.SwingUtilities#invokeLater(Runnable)}) * * @param underLyingSystem * @param useF1Classifier * @throws TeEngineMlException */ public void setUnderlyingSystem(SingleComponentUnderlyingSystem underLyingSystem, Boolean useF1Classifier) throws TeEngineMlException { this.underLyingSystem = underLyingSystem; Set<String> allowedDatasets = this.underLyingSystem.getAllowedDatasetNames().getMutableSetCopy(); if (allowedDatasets.size()>0) { cpe.getComboBoxDatasetNames().setModel(new DefaultComboBoxModel<String>(Utils.collectionToArray(allowedDatasets, new String[0]))); cpe.setDatasetNamesAllow(true); } else { cpe.setDatasetNamesAllow(false); } this.useF1Classifier = useF1Classifier; if (this.useF1Classifier!=null){if (this.useF1Classifier.booleanValue()) { cpe.setStatusBarClassifierType(VisualTracingTool.STATUS_BAR_CLASSIFIER_TYPE_F1_OPTIMIZED); cpe.updateStatusBarLabel(); }} }
/** * get the canonical Pos corresponding to the given TextPro pos * * @param textproPos * @return */ public static CanonicalPosTag textproPosToCannonical(TextProPosTag textproPos) { return TEXTPRO_TO_CANONICAL_MAP.getKeysOf(textproPos).iterator().next(); }
(extractionTypes.isEmpty()) ||
/** * return true iff this {@link StanfordDepedencyRelationType} is a valid relation between a NEGATIVE-factive predicate and its arg. * @param relation * @return */ public boolean isNegativeFactiveRelation(StanfordDepedencyRelationType relation) { if (!ComplementRelations.COMPLEMENT_RELATIONS.contains(relation)) return false; // the relation isn't argumental. factivity is impossible. else return this.equals(N_N); }