At Endpoint Protector, we like to take on challenges. When we received more and more requests from customers for the monitoring and blocking of source code, we decided to investigate the matter further and improve on our existing detection techniques. Like any intellectual property, after all, source code is often considered sensitive data depending on the sector a business operates in.
While there are libraries available for programming languages, for them to be effective, they must have an in-depth knowledge of the way these different languages operate in order to accurately differentiate between them.  This leads to complex, heavyweight databases that can severely affect the efficiency and speed of the software using them.
Knowing that N-gram-based text categorization had been successfully used to detect natural languages in text in a number of use cases, we theorized that the same system could be applied to programming languages.