language-classifier

Programming language classifier

language-classifier

Programming language classifier based on harthur's Bayesian classifier module.

$ npm install language-classifier
var lang = require('language-classifier');
 
lang('for link in links:');
// => "python" 
 
lang('Foo.prototype.bar = function(){}');
// => "javascript" 
 
lang('#include <stdio.h>');
// => "c" 

To train simply invoke make memory.

  • ruby
  • python
  • javascript
  • objective-c
  • html
  • css
  • shell
  • c++
  • c

MIT