Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
nlp-js-tools-french
Advanced tools
This package is partly based on the Snowball stemming algorythm and the javascript adaptation by Kasun Gajasinghe, University of Moratuwa
This package offers 4 NLP tools in javascript for french language :
npm install nlp-js-tools-french
var NlpjsTFr = require('nlp-js-tools-french');
Corpus to use
var corpus = "Elle semble se nourrir essentiellement de plancton, et de hotdog.";
Configs
var config = {
tagTypes: ['art', 'ver', 'nom'],
strictness: false,
minimumLength: 3,
debug: true
};
New instance with specific corpus and configs
var nlpToolsFr = new NlpjsTFr(corpus, config);
These are the available methods, self-explanatory. Note: The sentence that is passed into the class earlier is automaticaly tokenized.
var tokenizedWords = nlpToolsFr.tokenized;
var posTaggedWords = nlpToolsFr.posTagger();
var lemmatizedWords = nlpToolsFr.lemmatizer();
var stemmedWords = nlpToolsFr.stemmer();
var stemmedWord = nlpToolsFr.wordStemmer("aléatoirement");
Shows config
["semble", "nourrir", "de"]
[{
"id": 1,
"word": "semble",
"pos": [
"VER",
"VER"
]
},
{
"id": 2,
"word": "nourrir",
"pos": [
"VER"
]
},
{
"id": 3,
"word": "de",
"pos": [
"NOM",
"ART:def",
"PRE"
]
}]
[{
"id": 1,
"word": "semble",
"lemma": "sembler"
},
{
"id": 2,
"word": "nourrir",
"lemma": "nourrir"
},
{
"id": 3,
"word": "de",
"lemma": "de"
}]
[{
"id": 1,
"word": "semble",
"stem": "sembl"
},
{
"id": 3,
"word": "nourrir",
"stem": "nourr"
},
{
"id": 5,
"word": "de",
"stem": "de"
}]
{
word: "aléatoirement",
stem: "aléatoir"
}
Option | Type | Default | Description |
---|---|---|---|
tagTypes | Array | ["adj", "adv", "art", "con", "nom", "ono", "pre", "ver", "pro"] | List of dictionnaries the package will look in, in case you only need verbs or nouns, both or whatever else. If a word does not belong to any type, it is tagged as "UNK" . |
strictness | Bool | false | If you set the strictness to true and try to POS Tag the word generalement , it will fail because the word is missine its accents. On the other hand, trying to POS Tag the word dé with the strictness set to false well return the types art , pre and nom because the word will match de in these dictionnaries. |
minimumLength | Int | 1 | Algorythms will ignore words that are shorter than this parameter. |
debug | Bool | false | Enable console debug |
FAQs
POS Tagger and lemmatizer for javascript
The npm package nlp-js-tools-french receives a total of 113 weekly downloads. As such, nlp-js-tools-french popularity was classified as not popular.
We found that nlp-js-tools-french 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.