Detect-It-Easy/db/language
2024-04-29 17:01:42 +03:00

21 lines
No EOL
835 B
Text
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Author: DosX
// E-Mail: collab@kay-software.ru
// GitHub: https://github.com/DosX-dev
// Telegram: @DosX_dev
function _isLangDetected() {
return _getNumberOfResults("language") > 0;
}
function _setLang(languageName, isPositive, version) {
// If one programming language has already been detected, then we ignore the
// following results containing several variants of languages written with a
// slash. (For example, "C/C++" will not be added to the list of languages
// if there is already a detection of "C" or "C++")
if (_isLangDetected() && languageName.indexOf("/") !== -1)
return;
if ((isPositive == true || isPositive == undefined) && File.isVerbose() && !_isResultPresent("language", languageName))
_setResult("language", languageName, version ? version : "", "");
}