Skip to content

Instantly share code, notes, and snippets.

@sonnyksimon
Last active July 8, 2019 21:43
Show Gist options
  • Save sonnyksimon/13382927fd1f8c66865911063dc9f945 to your computer and use it in GitHub Desktop.
Save sonnyksimon/13382927fd1f8c66865911063dc9f945 to your computer and use it in GitHub Desktop.
JS Code Completion as a "N"LP Problem
JavaScript Code Completion as a "N"LP Problem
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://courses.csail.mit.edu/6.864/fall_2016/past_projects.html
Many techniques in natural language processing rely on statistical
methods because natural language is fuzzy and imprecise. In contrast,
computer languages follow precise known rules, so tools for working
with computer languages are usually strictly rule-based.
However, even in the realm of computer languages, some analysis tasks
may benefit from statistical methods by being able to capture
regularities in how computer code is authored, such as in the usage
of common APIs.
In this project I look at the task of code completion for traditional
JavaScript, a language that presents some challenges for static analysis
in the traditional sense due to its dynamic nature.
The task is as follows: given a corpus of existing JavaScript code and
a test program that includes blanks to be filled in, suggest a list
of possible completions for each blank.
I develop several approaches for this task, including a discriminative
model for predicting attribute and method names using contextual features
based on the abstract syntax tree of the JavaScript program.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment