I have a python script that reads in a file, should then detect the language of the code in the file, get the language ID from https://ghostbin.com/languages.json and upload it to https://ghostbin.com with the language ID as a parameter. The problem is detecting the programming language used. I haven't found any lib to help me out.
Asked
Active
Viewed 1,049 times
1 Answers
0
Here is a module that uses a Naive Bayes classifier to do what you want, with a corresponding discussion. The caveat is that the module needs to be trained on code samples. It should be easy enough to modify it to retain its training.