Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
geajack opened this issue Nov 16, 2022 · 0 comments
Open

Comments

@geajack
Copy link

geajack commented Nov 16, 2022

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"
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant