/DevClassify

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

Primary LanguagePHPGNU Affero General Public License v3.0AGPL-3.0

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
  • ...