Gets the lexical relations associated with the given sense.

@param sense The WordNet sense
@return A set of senses representing the sense with to the given sense
170409
public HashMultimap<WordNetRelation, Sense> getRelatedSenses(@NonNull Sense sense) {
        HashMultimap<WordNetRelation, Sense> map = HashMultimap.create();
        for (Map.Entry<Sense, WordNetRelation> entry : db
                                                           .getRelations(sense)
                                                           .entrySet()) {
            map.put(entry.getValue(), entry.getKey());
        }
        return map;
    }
1159838
public Set<Synset> getHypernyms(@NonNull Synset node) {
        return getRelatedSynsets(node, WordNetRelation.HYPERNYM);
    }
12838
def get_lexicons(self, num_terms=10):
        '''
        
        '''
        return {k: v.index[:num_terms]
                for k, v in self.lexicons.items()}
576903
public WordNetRelation getRelation(Sense from, Sense to) {
        if (from == null || to == null) {
            return null;
        }
        return db.getRelation(from, to);
    }
802872
@Override
    public List<IBond> getConnectedBondsList(IAtom atom) {
        List<IBond> bondsList = new ArrayList<IBond>();
        for (int i = 0; i < bondCount; i++) {
            if (bonds[i].contains(atom)) bondsList.add(bonds[i]);
        }
        return bondsList;
    }
1025128
@Override
  public Iterator<String> getPrefixes(String namespaceURI) {
    // per javax.xml.namespace.NamespaceContext doc
    if (namespaceURI == null)
      throw new IllegalArgumentException("Cannot find prefix for null namespace URI");

    List<String> list = new ArrayList<>();
    if (XMLConstants.XML_NS_URI.equals(namespaceURI))
      list.add(XMLConstants.XML_NS_PREFIX);
    else if (XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI))
      list.add(XMLConstants.XMLNS_ATTRIBUTE);
    else
      for (Map.Entry<String, String> entry: bindings.entrySet()) {
        if (namespaceURI.equals(entry.getValue()))
          list.add(entry.getKey());
      }

    return Collections.unmodifiableList(list).iterator();
  }
446606
def get_section_relations(Section):
    """"""
    all_rels = (Section._meta.get_all_related_objects() +
                Section._meta.get_all_related_many_to_many_objects())
    return filter_item_rels(all_rels)
820878
public Set<String> getResources(final Pattern pattern) {
        return getResources(new Predicate<String>() {
            public boolean apply(String input) {
                return pattern.matcher(input).matches();
            }
        });
    }
1034387
public Set<Synset> getRelatedSynsets(@NonNull Synset node, @NonNull WordNetRelation relation) {
        return db
                   .getRelations(node)
                   .entrySet()
                   .stream()
                   .filter(entry -> entry.getValue() == relation)
                   .map(entry -> db.getSynsetFromId(entry.getKey()))
                   .collect(Collectors.toSet());
    }
1286776
public Collection<Enhancement> parseEnhancements()
            throws EnhancementParserException {
        Multimap<Enhancement, String> relations = ArrayListMultimap.create();
        Map<String, Enhancement> enhancementsByUri = Maps.newHashMap();

        try {
            RepositoryConnection conn = repository.getConnection();
            try {
                conn.begin();

                parseTextAnnotations(conn, relations, enhancementsByUri);
                parseEntityAnnotations(conn, relations, enhancementsByUri);
                parseTopicAnnotations(conn, relations, enhancementsByUri);
                parseSentimentAnnotations(conn, relations, enhancementsByUri);
                parseKeywordAnnotations(conn, relations, enhancementsByUri);

                for (Enhancement e : relations.keys()) {
                    Collection<String> relationsUris = relations.get(e);
                    Collection<Enhancement> relationsEnhans = Sets.newHashSet();
                    for (String uri : relationsUris) {
                        relationsEnhans.add(enhancementsByUri.get(uri));
                    }
                    e.setRelations(relationsEnhans);
                }

                conn.commit();
            } finally {
                conn.close();
            }
        } catch (RepositoryException e) {
            throw new EnhancementParserException("Error querying the RDF Model obtained as Service Response", e);
        }

        return enhancementsByUri.values();
    }
107297
def _find_relations(self):
        """"""
        # Get all extractions
        extractions = \
            list(self.tree.execute("$.extractions[(@.@type is 'Extraction')]"))

        # Get relations from extractions
        relations = []
        for e in extractions:
            label_set = set(e.get('labels', []))
            # If this is a DirectedRelation
            if 'DirectedRelation' in label_set:
                self.relation_dict[e['@id']] = e
                subtype = e.get('subtype')
                if any(t in subtype for t in polarities.keys()):
                    relations.append((subtype, e))
            # If this is an Event or an Entity
            if {'Event', 'Entity'} & label_set:
                self.concept_dict[e['@id']] = e

        if not relations and not self.relation_dict:
            logger.info("No relations found.")
        else:
            logger.info('%d relations of types %s found'
                        % (len(relations), ', '.join(polarities.keys())))
            logger.info('%d relations in dict.' % len(self.relation_dict))
            logger.info('%d concepts found.' % len(self.concept_dict))
        return relations
893872
public Set<Synset> getSiblings(@NonNull Synset synset) {
        return getHypernyms(synset)
                   .stream()
                   .flatMap(s -> getHyponyms(s).stream())
                   .filter(s -> !s.equals(synset))
                   .collect(Collectors.toSet());
    }
11845
public R getRelationships() {
        R r = new R(factory.getTotalConcepts(), factory.getTotalRoles());
        
        // Collect subsumptions from context index
        for (IntIterator it = contextIndex.keyIterator(); it.hasNext();) {
            int key = it.next();
            Context ctx = contextIndex.get(key);
            int concept = ctx.getConcept();
            CR pred = ctx.getPred();
            CR succ = ctx.getSucc();
            
            int[] predRoles = pred.getRoles();
            for(int i = 0; i < predRoles.length; i++) {
                IConceptSet cs = pred.lookupConcept(predRoles[i]);
                for(IntIterator it2 = cs.iterator(); it2.hasNext(); ) {
                    int predC = it2.next();
                    r.store(predC, predRoles[i], concept);
                }
            }
            
            int[] succRoles = succ.getRoles();
            for(int i = 0; i < succRoles.length; i++) {
                IConceptSet cs = succ.lookupConcept(succRoles[i]);
                for(IntIterator it2 = cs.iterator(); it2.hasNext(); ) {
                    int succC = it2.next();
                    r.store(concept, succRoles[i], succC);
                }
            }
        }
        
        return r;
    }
544625
@Override
    public IRingSet getRings(IBond bond) {
        IRingSet rings = bond.getBuilder().newInstance(IRingSet.class);
        Ring ring;
        for (int i = 0; i < getAtomContainerCount(); i++) {
            ring = (Ring) getAtomContainer(i);
            if (ring.contains(bond)) {
                rings.addAtomContainer(ring);
            }
        }
        return rings;
    }
1261214
public Set<String> keys(String pattern) {
        Set<String> result = new TreeSet<String>();
        for (String key : keys()) {
            if (key.matches(pattern)) result.add(key);
        }
        return result;
    }
565402
public Map<String, Float> getTermAndRank(String content)
    {
        assert content != null;
        List<Term> termList = defaultSegment.seg(content);
        return getTermAndRank(termList);
    }
1107991
public static List<Word> getWords(String text) {
        List<Word> result = new ArrayList<>();
        List<Word> words = WordParser.parse(text);
        for (Word word : words) {
            result.add(word);
        }
        return result;
    }