Skip to content

Many code snippets reference undefined (presumably static?) methods #7

Description

@jack-jjm

I've found that many of the code snippets in ConCode reference methods that aren't defined in the memberFunctions field. An example is line 13 of test_shuffled.json, printed below. The code references a function called search(), but it's not defined in the metadata. I'm assuming that what happened here is that the file this was taken from statically imported the (static) search() method from some other class, but I just wanted to check that this is indeed why this happens and that you're aware of this feature of the dataset.

{
  "memberVariables": {
    "middle": "TSTNode",
    "data": "char",
    "left": "TSTNode",
    "root": "TSTNode",
    "right": "TSTNode",
    "al": "ArrayList<String>",
    "is_End_Of_String": "boolean"
  },
  "code": [
    "boolean",
    "function",
    "(",
    "String",
    "word",
    ")",
    "{",
    "return",
    "search",
    "(",
    "root",
    ",",
    "word",
    ".",
    "toCharArray",
    "(",
    ")",
    ",",
    "0",
    ")",
    ";",
    "}"
  ],
  "memberFunctions": {
    "traverse": [
      [
        "void",
        "TSTNode key",
        "String str"
      ]
    ],
    "makeEmpty": [
      [
        "void"
      ]
    ],
    "isEmpty": [
      [
        "boolean"
      ]
    ],
    "insert": [
      [
        "void",
        "String word"
      ],
      [
        "TSTNode",
        "TSTNode key",
        "char[] word",
        "int pos"
      ]
    ],
    "toString": [
      [
        "String"
      ]
    ],
    "main": [
      [
        "void",
        "String[] args"
      ]
    ],
    "delete": [
      [
        "void",
        "String word"
      ],
      [
        "void",
        "TSTNode key",
        "char[] word",
        "int pos"
      ]
    ]
  },
  "repo": "repo_24058027",
  "className": "TernarySearchTree",
  "renamed": [
    "boolean",
    "function",
    "(",
    "String",
    "arg0",
    ")",
    "{",
    "return",
    "search",
    "(",
    "root",
    ",",
    "arg0",
    ".",
    "toCharArray",
    "(",
    ")",
    ",",
    "0",
    ")",
    ";",
    "}"
  ],
  "nl": "function to search for a word",
  "nlToks": [
    "function",
    "to",
    "search",
    "for",
    "a",
    "word"
  ]
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions