A text classification approach to API type resolution for incomplete code snippets