Giter Site home page Giter Site logo

sskodje / codeclassifier Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bertyhell/codeclassifier

0.0 2.0 0.0 962 KB

You provide a snippet and this c# library will tell you what language it's written in.

License: MIT License

C# 5.95% CoffeeScript 4.29% Objective-C 10.62% Shell 0.88% C++ 5.97% C 3.27% CSS 27.50% HTML 4.68% JavaScript 5.18% Python 5.38% Ruby 6.28% Java 16.20% Tcl 0.08% PHP 3.72%

codeclassifier's Introduction

CodeClassifier

You provide a snippet and this c# library will tell you what language it was written in.

Supported languages:

  • ruby
  • shell
  • c
  • c++
  • coffee-script
  • csharp
  • css
  • html
  • javascript
  • objective-c
  • python

You can add your own languages by adding a file to the training-set folder. The name of the file has to be the language name. The file has to contain a good representation of the programming language syntax. Look at the other files to get an idea of what that means.

Technology

Uses .NET 4.0 C#

Inner workings

The way it calculates the best matching language is by having a number of training files. It reads those, splits the code up in tokens and then generates a tree where every subnode is a possible token to follow the current one.

Then when you want to classify some code, it also tokenizes that code and checks all the match trees that it build in the previous step. The bigger the parts of your code that match with nodes in the match tree, the higher your code scores for a specific language. The language with the highest score will be returned.

codeclassifier's People

Contributors

bertyhell avatar sskodje avatar lucaslin avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.