Loads a vocabulary file into a dictionary.
965209
def load_vocab(vocab_file):
    """"""
    vocab = collections.OrderedDict()
    index = 0
    with io.open(vocab_file, 'r') as reader:
        while True:
            token = reader.readline()
            if not token:
                break
            token = token.strip()
            vocab[token] = index
            index += 1
    return vocab
1079831
def load(cls, file_path):
        

        # convert back to numpy
        data = helper.read_json(file_path)
        return Concise.from_dict(data)
563654
def _load_fast(filename):
        """"""
        it = json.load(open("{}_items.json".format(filename)))
        words, unk_index, name = it["items"], it["unk_index"], it["name"]
        vectors = np.load(open("{}_vectors.npy".format(filename), 'rb'))
        return words, unk_index, name, vectors
329408
def load(self, f, line=None):
        """"""
        if line is None:
            # in case the file contains only a fragment of an input file,
            # this is useful.
            line = f.readlin()
        words = line[1:].split()
        self.__name = words[0].upper()
        self.section_parameters = " ".join(words[1:])
        try:
            self.load_children(f)
        except EOFError:
            raise FileFormatError("Unexpected end of file, section '%s' not ended." % self.__name)
914929
def from_vocabfile(cls, filename):
    
    words = [x.strip() for x in _open(filename, 'r').read().splitlines()]
    return cls(words=words)
1174799
public void load( File file )
            throws NumberFormatException, FileNotFoundException, IOException
    {
        loadWords(config, this, file, synBuffer);
    }
727155
def load_vocab(self, vocab_name, **kwargs):
        
        log.setLevel(kwargs.get("log_level", self.log_level))

        vocab = self.get_vocab(vocab_name   , **kwargs)
        if vocab['filename'] in self.loaded:
            if self.loaded_times.get(vocab['filename'],
                    datetime.datetime(2001,1,1)).timestamp() \
                    < vocab['modified']:
                self.drop_file(vocab['filename'], **kwargs)
            else:
                return
        conn = kwargs.get("conn", self.conn)
        conn.load_data(graph=getattr(__NSM__.kdr, vocab['filename']).clean_uri,
                       data=vocab['data'],
                       datatype=vocab['filename'].split(".")[-1],
                       log_level=logging.WARNING)
        self.__update_time__(vocab['filename'], **kwargs)
        log.warning("\n\tvocab: '%s' loaded \n\tconn: '%s'",
                    vocab['filename'],
                    conn)
        self.loaded.append(vocab['filename'])
398224
def load(f, dict_=dict):
    
    if not f.read:
        raise ValueError('The first parameter needs to be a file object, ',
                         '%r is passed' % type(f))
    return loads(f.read(), dict_)
859944
def load(self, filename):
        """"""
        f = io.open(filename,'r',encoding='utf-8')
        for line in f:
            data = line.strip().split("\t")
            type, count = data[:2]
            self.count(type,count)
        f.close()
782844
def from_vocabfile(filename):
    
    word_count = [x.strip().split() for x in _open(filename, 'r').read().splitlines()]
    word_count = {w:int(c) for w,c in word_count}
    return CountedVocabulary(word_count=word_count)
485939
def load(self, text, fieldnames=None):
    """"""
    lines = text.split('\n')
    fieldnames = load_line(lines[0])
    values = load_line(lines[1])
    self.__dict__ = dict(zip(fieldnames, values))
652069
def load_target_vocab(folder: str) -> Vocab:
    
    return vocab_from_json(os.path.join(folder, C.VOCAB_TRG_NAME % 0))
58401
def _build_vocab(filename, vocab_dir, vocab_name):
  
  vocab_path = os.path.join(vocab_dir, vocab_name)
  if not tf.gfile.Exists(vocab_path):
    with tf.gfile.GFile(filename, "r") as f:
      data = f.read().split()
    counter = collections.Counter(data)
    count_pairs = sorted(counter.items(), key=lambda x: (-x[1], x[0]))
    words, _ = list(zip(*count_pairs))
    encoder = text_encoder.TokenTextEncoder(None, vocab_list=words)
    encoder.store_to_file(vocab_path)
  else:
    encoder = text_encoder.TokenTextEncoder(vocab_path)
  return encoder
419745
def loadFromFile(self, filename):
        """"""
        file = open(filename, 'rb')
        try:
            wsdl = self.loadFromStream(file)
        finally:
            file.close()
        return wsdl
429778
def load_or_create_vocab(data: str, vocab_path: Optional[str], num_words: int, word_min_count: int,
                         pad_to_multiple_of: Optional[int] = None) -> Vocab:
    
    if vocab_path is None:
        return build_from_paths(paths=[data], num_words=num_words, min_count=word_min_count,
                                pad_to_multiple_of=pad_to_multiple_of)
    else:
        return vocab_from_json(vocab_path)
218905
def load(self, config):
        """"""
        password_dict = {}

        if config is None:
            logger.warning("No configuration file available. Cannot load password list.")
        elif not config.has_section(self._section):
            logger.warning("No [%s] section in the configuration file. Cannot load password list." % self._section)
        else:
            logger.info("Start reading the [%s] section in the configuration file" % self._section)

            password_dict = dict(config.items(self._section))

            # Password list loaded
            logger.info("%s password(s) loaded from the configuration file" % len(password_dict))
            logger.debug("Password dictionary: %s" % password_dict)

        return password_dict
371135
private function loadFullDictionary(): void
    {
        $file = __DIR__ . '/../Dictionary/' . $this->language;
        if (!file_exists($file)) {
            $file = __DIR__ . '/../Dictionary/en_US';
        }

        self::$dictionary = array_filter(explode(PHP_EOL, file_get_contents($file)));
    }