/** * Returns an EnglishGrammaticalRelation based on the argument. * It works if passed a GrammaticalRelation or the String * representation of one (e.g. "nsubj"). It returns <code>null</code> * for other classes or if no string match is found. * * @param o A GrammaticalRelation or String * @return The EnglishGrammaticalRelation with that name */ @SuppressWarnings("unchecked") public static GrammaticalRelation valueOf(Object o) { if (o instanceof GrammaticalRelation) { return (GrammaticalRelation) o; } else if (o instanceof Class) { try { return getRelation((Class<? extends GrammaticalRelationAnnotation>) o); } catch (Exception e) { return null; } } else if (o instanceof String) { return valueOf((String) o); } else { return null; } }
/** * Returns an EnglishGrammaticalRelation based on the argument. * It works if passed a GrammaticalRelation or the String * representation of one (e.g. "nsubj"). It returns <code>null</code> * for other classes or if no string match is found. * * @param o A GrammaticalRelation or String * @return The EnglishGrammaticalRelation with that name */ @SuppressWarnings("unchecked") public static GrammaticalRelation valueOf(Object o) { if (o instanceof GrammaticalRelation) { return (GrammaticalRelation) o; } else if (o instanceof Class) { try { return getRelation((Class<? extends GrammaticalRelationAnnotation>) o); } catch (Exception e) { return null; } } else if (o instanceof String) { return valueOf((String) o); } else { return null; } }
GrammaticalRelation reln2 = GrammaticalRelation.getRelation(arcLabel); if (!list.isEmpty()) { for (int i = 0; i < list.size(); i++) {
GrammaticalRelation reln = GrammaticalRelation.getRelation(arcLabel); boolean descendantFound = false; for (int index = 0; index < list.size(); ++index) {
GrammaticalRelation reln2; try { reln2 = GrammaticalRelation.getRelation(arcLabel); } catch (Exception e) { continue;
GrammaticalRelation reln2; try { reln2 = GrammaticalRelation.getRelation(arcLabel); } catch (Exception e) { continue;