webfashionist / DevClassify

DevClassify analyzes the source code of several programming languages and returns the probabilities for each language with the recommended file extension.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DevClassify

DevClassify analyzes the source code of several programming languages and returns the probabilities for each language with the recommended file extension.

Usage

To implement DevClassify in your project, you only need to include the src/classes/ProgrammingLanguage.class.php class and call the check() method. You can find an example in tests/checkLanguage.php.

<?php
include "src/classes/ProgrammingLanguage.class.php";

$ProgrammingLanguage = new ProgrammingLanguage();
$result = $ProgrammingLanguage->check($yourCode); // set your code as parameter of this method

// probabilities:
var_dump($result->probabilities);

echo '<br>';
// recommended file extension:
echo $result->extension;
?>

Languages

  • HTML
  • XML (XML snippets will be identified as HTML - the <?xml > tag must be set)
  • CSS
  • JavaScript
  • PHP
  • SQL
  • JSON
  • Bash
  • Python
  • ...

About

DevClassify analyzes the source code of several programming languages and returns the probabilities for each language with the recommended file extension.

License:GNU Affero General Public License v3.0


Languages

Language:PHP 100.0%