Tolmach: Node.js 代码语言分类工具
Tolmach 是一个基于模块的编程语言分类器。通过安装 $ npm install tolmach,可以使用如下示例代码进行语言检测:
var tolmach = require('tolmach');
tolmach.detect('for item in items:'); // => "python"
tolmach.detect('#include '); // => "c"
tolmach.detect('prices = items.map{ |i| i.price }'); // => "ruby"
Tolmach 支持的编程语言包括:C, C#, Fortran, Go, Haskell, JavaScript, Lisp, Lua, Objective-C, Perl, PHP, Python, Ruby, Rust, Shell, Swift, VB.NET。
420.27KB
文件大小:
评论区