def _get_synset_offsets(synset_idxes):
    """Returs pointer offset in the WordNet file for every synset index.

    Notes
    -----
    Internal function. Do not call directly.
    Preserves order -- for [x,y,z] returns [offset(x),offset(y),offset(z)].

    Parameters
    ----------
    synset_idxes : list of ints
      Lists synset IDs, which need offset.
      
    Returns
    -------
    list of ints
      Lists pointer offsets in Wordnet file.


    """
    offsets = {}
    current_seeked_offset_idx = 0

    ordered_synset_idxes = sorted(synset_idxes)

    with codecs.open(_SOI,'rb', 'utf-8') as fin:
        for line in fin:
            split_line = line.split(':')
          
            while current_seeked_offset_idx < len(ordered_synset_idxes) and split_line[0] == str(ordered_synset_idxes[current_seeked_offset_idx]):
                # Looping on single line entries in case synset_indexes contains duplicates.
                offsets[synset_idxes[current_seeked_offset_idx]] = int(split_line[1])
                current_seeked_offset_idx += 1
            if current_seeked_offset_idx >= len(synset_idxes):
                break
    return [offsets[synset_idx] for synset_idx in synset_idxes]
def _get_synset_offsets ( synset_idxes ) : offsets = { } current_seeked_offset_idx = 0 ordered_synset_idxes = sorted ( synset_idxes ) with codecs . open ( _SOI , 'rb' , 'utf-8' ) as fin : for line in fin : split_line = line . split ( ':' ) while current_seeked_offset_idx < len ( ordered_synset_idxes ) and split_line [ 0 ] == str ( ordered_synset_idxes [ current_seeked_offset_idx ] ) : offsets [ synset_idxes [ current_seeked_offset_idx ] ] = int ( split_line [ 1 ] ) current_seeked_offset_idx += 1 if current_seeked_offset_idx >= len ( synset_idxes ) : break return [ offsets [ synset_idx ] for synset_idx in synset_idxes ]
Returs pointer offset in the WordNet file for every synset index.

    Notes
    -----
    Internal function. Do not call directly.
    Preserves order -- for [x,y,z] returns [offset(x),offset(y),offset(z)].

    Parameters
    ----------
    synset_idxes : list of ints
      Lists synset IDs, which need offset.
      
    Returns
    -------
    list of ints
      Lists pointer offsets in Wordnet file.