class_docstr: Basic tests on the built-in parlai Dictionary.
class_docstr_tok: ["Basic","tests","on","the","built-in","parlai","Dictionary","."]
docstr: Test the ngram class properly recognize uni, bi, and trigrams test.
code: def test_find_ngrams(self):
      """
      Test the ngram class properly recognize uni, bi, and trigrams test.
      """
      s = set()
      s.add("hello world")
      s.add("ol boy")
      res = find_ngrams(s, ["hello", "world", "buddy", "ol", "boy"], 2)
      assert " ".join(res) == "hello world buddy ol boy"
      assert "-".join(res) == "hello world-buddy-ol boy"
      s.add("world buddy ol")
      res = find_ngrams(s, ["hello", "world", "buddy", "ol", "boy"], 3)
      assert " ".join(res) == "hello world buddy ol boy"
      assert "-".join(res) == "hello-world buddy ol-boy"
      s.add("hello world buddy")
      res = find_ngrams(s, ["hello", "world", "buddy", "ol", "boy"], 3)
      assert " ".join(res) == "hello world buddy ol boy"
      assert "-".join(res) == "hello world buddy-ol boy"
  
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 4 for calling the TestDictionary obj's underlying member method code with example usage: obj.test_find_ngrams() without return types