{"id":14384639,"url":"https://github.com/bastienbot/nlp-js-tools-french","last_synced_at":"2025-08-01T23:30:55.843Z","repository":{"id":65424594,"uuid":"88985501","full_name":"bastienbot/nlp-js-tools-french","owner":"bastienbot","description":"POS Tagger, lemmatizer and stemmer for french language in javascript","archived":false,"fork":false,"pushed_at":"2017-09-13T13:58:49.000Z","size":1087,"stargazers_count":36,"open_issues_count":1,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-08T23:52:18.609Z","etag":null,"topics":["lemmatization","lemmatizer","nlp","postagging","postgresql","stemmer","stemming","tokenization","tokenizer"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bastienbot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-21T13:15:33.000Z","updated_at":"2023-11-08T21:50:26.000Z","dependencies_parsed_at":"2023-01-23T10:55:20.718Z","dependency_job_id":null,"html_url":"https://github.com/bastienbot/nlp-js-tools-french","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bastienbot%2Fnlp-js-tools-french","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bastienbot%2Fnlp-js-tools-french/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bastienbot%2Fnlp-js-tools-french/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bastienbot%2Fnlp-js-tools-french/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bastienbot","download_url":"https://codeload.github.com/bastienbot/nlp-js-tools-french/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228414011,"owners_count":17915921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lemmatization","lemmatizer","nlp","postagging","postgresql","stemmer","stemming","tokenization","tokenizer"],"created_at":"2024-08-28T18:01:32.329Z","updated_at":"2024-12-06T05:09:14.952Z","avatar_url":"https://github.com/bastienbot.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# NLP Javascript tools for french language\n#### Tokenize, POS Tagger, lemmatizer and stemmer\n\nThis package is partly based on the [Snowball stemming algorythm](https://snowballstem.org/algorithms/french/stemmer.html) and the [javascript adaptation](http://snowball.tartarus.org/otherlangs/french_javascript.txt) by _Kasun Gajasinghe, University of Moratuwa_\n\nThis package offers 4 NLP tools in javascript for french language :\n* Tokenizing\n* POS Tagging\n* Lemmatizing\n* Stemming\n\n## Install\n```\nnpm install nlp-js-tools-french\n```\n\n## Usage\n```\nvar NlpjsTFr = require('nlp-js-tools-french');\n```\nCorpus to use\n```\nvar corpus = \"Elle semble se nourrir essentiellement de plancton, et de hotdog.\";\n```\nConfigs\n```\nvar config = {\n    tagTypes: ['art', 'ver', 'nom'],\n    strictness: false,\n    minimumLength: 3,\n    debug: true\n};\n```\n\nNew instance with specific corpus and configs\n```\nvar nlpToolsFr = new NlpjsTFr(corpus, config);\n```\n\nThese are the available methods, self-explanatory.\n**Note:** The sentence that is passed into the class earlier is automaticaly tokenized.\n```\nvar tokenizedWords = nlpToolsFr.tokenized;\nvar posTaggedWords = nlpToolsFr.posTagger();\nvar lemmatizedWords = nlpToolsFr.lemmatizer();\nvar stemmedWords = nlpToolsFr.stemmer();\nvar stemmedWord = nlpToolsFr.wordStemmer(\"aléatoirement\");\n```\n\n## Attributes\n\n#### config\nShows config\n#### tokenized\n```\n[\"semble\", \"nourrir\", \"de\"]\n```\n\n## Methods return\n\n#### posTagger()\n```\n[{\n  \"id\": 1,\n  \"word\": \"semble\",\n  \"pos\": [\n   \"VER\",\n   \"VER\"\n  ]\n },\n {\n  \"id\": 2,\n  \"word\": \"nourrir\",\n  \"pos\": [\n   \"VER\"\n  ]\n },\n {\n  \"id\": 3,\n  \"word\": \"de\",\n  \"pos\": [\n   \"NOM\",\n   \"ART:def\",\n   \"PRE\"\n  ]\n }]\n```\n#### lemmatizer()\n```\n[{\n  \"id\": 1,\n  \"word\": \"semble\",\n  \"lemma\": \"sembler\"\n },\n {\n  \"id\": 2,\n  \"word\": \"nourrir\",\n  \"lemma\": \"nourrir\"\n },\n {\n  \"id\": 3,\n  \"word\": \"de\",\n  \"lemma\": \"de\"\n }]\n```\n#### stemmer()\n```\n[{\n  \"id\": 1,\n  \"word\": \"semble\",\n  \"stem\": \"sembl\"\n },\n {\n  \"id\": 3,\n  \"word\": \"nourrir\",\n  \"stem\": \"nourr\"\n },\n {\n  \"id\": 5,\n  \"word\": \"de\",\n  \"stem\": \"de\"\n}]\n```\n\n#### wordStemmer(word)\n```\n{\n    word: \"aléatoirement\",\n    stem: \"aléatoir\"\n}\n```\n\n## Config\n\nOption | Type | Default | Description\n--- | --- | --- | ---\ntagTypes | 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\"`.\nstrictness | 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.\nminimumLength | Int | 1 | Algorythms will ignore words that are shorter than this parameter.\ndebug | Bool | false | Enable console debug\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbastienbot%2Fnlp-js-tools-french","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbastienbot%2Fnlp-js-tools-french","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbastienbot%2Fnlp-js-tools-french/lists"}