class_docstr: Basic tests on the built-in parlai Dictionary.
class_docstr_tok: ["Basic","tests","on","the","built-in","parlai","Dictionary","."]
docstr: Check the dictionary is correctly adding and parsing short sentence.
code: def test_basic_parse(self):
      """
      Check the dictionary is correctly adding and parsing short sentence.
      """
      parser = ParlaiParser()
      DictionaryAgent.add_cmdline_args(parser, partial_opt=None)
      opt = parser.parse_args([])
      dictionary = DictionaryAgent(opt)
      num_builtin = len(dictionary)
  
      dictionary.observe({"text": "hello world"})
      dictionary.act()
      assert len(dictionary) - num_builtin == 2
  
      vec = dictionary.parse("hello world")
      assert len(vec) == 2
      assert vec[0] == num_builtin
      assert vec[1] == num_builtin + 1
  
      vec = dictionary.parse("hello world", vec_type=list)
      assert len(vec) == 2
      assert vec[0] == num_builtin
      assert vec[1] == num_builtin + 1
  
      vec = dictionary.parse("hello world", vec_type=tuple)
      assert len(vec) == 2
      assert vec[0] == num_builtin
      assert vec[1] == num_builtin + 1
  
imports: from parlai.core.build_data import modelzoo_path
  from parlai.core.dict import find_ngrams
  from parlai.core.params import ParlaiParser
  from parlai.core.dict import DictionaryAgent, TokenizationMode
  from parlai.core.opt import Opt
  import parlai.scripts.build_dict
  from parlai.utils.io import PathManager
  import parlai.utils.testing
  import os
  import shutil
  import unittest
  import pytest
label_desc: Use image node_id 5 for calling the TestDictionary obj's underlying member method code with example usage: obj.test_basic_parse() without return types