Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
detect-lang
Advanced tools
**Node.js module: input text, get language it's written in. It's that simple. **
Based on Thenable Promises and thus working asynchronously, this module uses retext to analyse files & strings using Node.js
npm install detect-lang
then:
var detect = require('detect-lang');
var input = "Quand tu sauras mon crime, et le sort qui m'accable, je n'en mourrai pas moins, j'en mourrai plus coupable." // Phèdre, Racine, I-3.
detect(input)
.then(function(data) {
console.log(data);
});
Output:
Object {
iso6391: 'fr',
iso6392: null,
terminologic: 'fra',
bibliographic: 'fre',
name: 'French',
probability: '100.00',
detected_langs: {
fra: 1
}
}
ISO-639 is a pretty common standard. However, for best results, the output of 'iso6392' can be null
when there are terminologic and bibliographic variants. Read the explaination of the ISO-639-2 on Wikipedia if you're confused.
This code is registered under GPLv3 - Copyright (c) 2015 Jean van Kasteel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/
FAQs
Input text, get language used. It's that simple.
The npm package detect-lang receives a total of 11 weekly downloads. As such, detect-lang popularity was classified as not popular.
We found that detect-lang demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.