class_docstr: Helper class for aggregating and building `Vocabulary` objects.
class_docstr_tok: ["Helper","class","for","aggregating","and","building","`","Vocabulary","`","objects","."]
code: def add_from_file(
      self,
      file_pointer,
      skip_header_line,
      lowercase_tokens,
      size,
      re_sort=True,
  ):
      vocab_from_file = []
      if skip_header_line:
          next(file_pointer)
      for i, line in enumerate(file_pointer):
          if size and len(vocab_from_file) == size:
              print(
                  f"Read {i + 1} items from vocab file and loaded {size} tokens. "
                  f"Skipping rest of the file."
              )
              break
          token = line.split(self.delimiter)[0].strip()
          if lowercase_tokens:
              token = token.lower()
          vocab_from_file.append(token)
      if re_sort:
          vocab_from_file = set(vocab_from_file)
          self.add_all(sorted(vocab_from_file))
      else:
          self.add_all(vocab_from_file)
  
imports: import itertools
  from collections import Counter
  from typing import Dict, List, Optional, Tuple
  import torch
  from pytext.common.constants import SpecialTokens, Token
  from pytext.utils import cuda, precision
label_desc: Use image node_id 4 for calling the VocabBuilder obj's underlying member method code with example usage: obj.add_from_file(file_pointer, skip_header_line, lowercase_tokens, size, re_sort) without return types