Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stopword

Package Overview
Dependencies
Maintainers
2
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stopword - npm Package Compare versions

Comparing version 0.3.5 to 1.0.0

dist/stopword.0.3.6.js

28

lib/stopword.js
var defaultStopwords = require('./stopwords_en.js').words
exports.removeStopwords = function(tokens, stopwords) {
exports.removeStopwords = function (tokens, stopwords) {
stopwords = stopwords || defaultStopwords
if (typeof tokens !== 'object' || typeof stopwords != 'object'){
throw new Error ('expected Arrays try: removeStopwords(Array[, Array])')
if (typeof tokens !== 'object' || typeof stopwords !== 'object') {
throw new Error('expected Arrays try: removeStopwords(Array[, Array])')
}

@@ -16,9 +16,18 @@ return tokens.filter(function (value) {

exports.bn = require('./stopwords_bn.js').words
exports.bg = require('./stopwords_bg.js').words
exports.br = require('./stopwords_br.js').words
exports.ca = require('./stopwords_ca.js').words
exports.cs = require('./stopwords_cs.js').words
exports.da = require('./stopwords_da.js').words
exports.de = require('./stopwords_de.js').words
exports.el = require('./stopwords_el.js').words
exports.en = require('./stopwords_en.js').words
exports.eo = require('./stopwords_eo.js').words
exports.es = require('./stopwords_es.js').words
exports.et = require('./stopwords_et.js').words
exports.eu = require('./stopwords_eu.js').words
exports.fa = require('./stopwords_fa.js').words
exports.fr = require('./stopwords_fr.js').words
exports.ga = require('./stopwords_ga.js').words
exports.gl = require('./stopwords_gl.js').words
exports.fi = require('./stopwords_fi.js').words

@@ -28,7 +37,14 @@ exports.ha = require('./stopwords_ha.js').words

exports.hi = require('./stopwords_hi.js').words
exports.hr = require('./stopwords_hr.js').words
exports.hu = require('./stopwords_hu.js').words
exports.hy = require('./stopwords_hy.js').words
exports.id = require('./stopwords_id.js').words
exports.it = require('./stopwords_it.js').words
exports.ja = require('./stopwords_ja.js').words
exports.ko = require('./stopwords_ko.js').words
exports.la = require('./stopwords_la.js').words
exports.lgg = require('./stopwords_lgg.js').words
exports.lggo = require('./stopwords_lggo.js').words
exports.lv = require('./stopwords_lv.js').words
exports.mr = require('./stopwords_mr.js').words
exports.my = require('./stopwords_my.js').words

@@ -40,3 +56,7 @@ exports.nl = require('./stopwords_nl.js').words

exports.pt = require('./stopwords_pt.js').words
exports.ptbr = require('./stopwords_ptbr.js').words
exports.ro = require('./stopwords_ro.js').words
exports.ru = require('./stopwords_ru.js').words
exports.sk = require('./stopwords_sk.js').words
exports.sl = require('./stopwords_sl.js').words
exports.so = require('./stopwords_so.js').words

@@ -46,2 +66,4 @@ exports.st = require('./stopwords_st.js').words

exports.sw = require('./stopwords_sw.js').words
exports.th = require('./stopwords_th.js').words
exports.tr = require('./stopwords_tr.js').words
exports.vi = require('./stopwords_vi.js').words

@@ -48,0 +70,0 @@ exports.yo = require('./stopwords_yo.js').words

615

lib/stopwords_br.js

@@ -1,602 +0,19 @@

// Original copyright:
/*
Copyright (c) 2017, Micael Levi
// Copyright (c) 2017 Peter Graham, contributors. Released under the Apache-2.0 license.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
// This version:
/*
The MIT License (MIT)
Copyright (c) 2017 Fabrício Rodrigues
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
// a list of commonly used words (pt-BR) that have little meaning and can be excluded
// from analysis.
var words = [
'a',
'à',
'adeus',
'agora',
'aí',
'ainda',
'além',
'algo',
'alguém',
'algum',
'alguma',
'algumas',
'alguns',
'ali',
'ampla',
'amplas',
'amplo',
'amplos',
'ano',
'anos',
'ante',
'antes',
'ao',
'aos',
'apenas',
'apoio',
'após',
'aquela',
'aquelas',
'aquele',
'aqueles',
'aqui',
'aquilo',
'área',
'as',
'às',
'assim',
'até',
'atrás',
'através',
'baixo',
'bastante',
'bem',
'boa',
'boas',
'bom',
'bons',
'breve',
'cá',
'cada',
'catorze',
'cedo',
'cento',
'certamente',
'certeza',
'cima',
'cinco',
'coisa',
'coisas',
'com',
'como',
'conselho',
'contra',
'contudo',
'custa',
'da',
'dá',
'dão',
'daquela',
'daquelas',
'daquele',
'daqueles',
'dar',
'das',
'de',
'debaixo',
'dela',
'delas',
'dele',
'deles',
'demais',
'dentro',
'depois',
'desde',
'dessa',
'dessas',
'desse',
'desses',
'desta',
'destas',
'deste',
'destes',
'deve',
'devem',
'devendo',
'dever',
'deverá',
'deverão',
'deveria',
'deveriam',
'devia',
'deviam',
'dez',
'dezanove',
'dezasseis',
'dezassete',
'dezoito',
'dia',
'diante',
'disse',
'disso',
'disto',
'dito',
'diz',
'dizem',
'dizer',
'do',
'dois',
'dos',
'doze',
'duas',
'dúvida',
'e',
'é',
'ela',
'elas',
'ele',
'eles',
'em',
'embora',
'enquanto',
'entre',
'era',
'eram',
'éramos',
'és',
'essa',
'essas',
'esse',
'esses',
'esta',
'está',
'estamos',
'estão',
'estar',
'estas',
'estás',
'estava',
'estavam',
'estávamos',
'este',
'esteja',
'estejam',
'estejamos',
'estes',
'esteve',
'estive',
'estivemos',
'estiver',
'estivera',
'estiveram',
'estivéramos',
'estiverem',
'estivermos',
'estivesse',
'estivessem',
'estivéssemos',
'estiveste',
'estivestes',
'estou',
'etc',
'eu',
'exemplo',
'faço',
'falta',
'favor',
'faz',
'fazeis',
'fazem',
'fazemos',
'fazendo',
'fazer',
'fazes',
'feita',
'feitas',
'feito',
'feitos',
'fez',
'fim',
'final',
'foi',
'fomos',
'for',
'fora',
'foram',
'fôramos',
'forem',
'forma',
'formos',
'fosse',
'fossem',
'fôssemos',
'foste',
'fostes',
'fui',
'geral',
'grande',
'grandes',
'grupo',
'há',
'haja',
'hajam',
'hajamos',
'hão',
'havemos',
'havia',
'hei',
'hoje',
'hora',
'horas',
'houve',
'houvemos',
'houver',
'houvera',
'houverá',
'houveram',
'houvéramos',
'houverão',
'houverei',
'houverem',
'houveremos',
'houveria',
'houveriam',
'houveríamos',
'houvermos',
'houvesse',
'houvessem',
'houvéssemos',
'isso',
'isto',
'já',
'la',
'lá',
'lado',
'lhe',
'lhes',
'lo',
'local',
'logo',
'longe',
'lugar',
'maior',
'maioria',
'mais',
'mal',
'mas',
'máximo',
'me',
'meio',
'menor',
'menos',
'mês',
'meses',
'mesma',
'mesmas',
'mesmo',
'mesmos',
'meu',
'meus',
'mil',
'minha',
'minhas',
'momento',
'muita',
'muitas',
'muito',
'muitos',
'na',
'nada',
'não',
'naquela',
'naquelas',
'naquele',
'naqueles',
'nas',
'nem',
'nenhum',
'nenhuma',
'nessa',
'nessas',
'nesse',
'nesses',
'nesta',
'nestas',
'neste',
'nestes',
'ninguém',
'nível',
'no',
'noite',
'nome',
'nos',
'nós',
'nossa',
'nossas',
'nosso',
'nossos',
'nova',
'novas',
'nove',
'novo',
'novos',
'num',
'numa',
'número',
'nunca',
'o',
'obra',
'obrigada',
'obrigado',
'oitava',
'oitavo',
'oito',
'onde',
'ontem',
'onze',
'os',
'ou',
'outra',
'outras',
'outro',
'outros',
'para',
'parece',
'parte',
'partir',
'paucas',
'pela',
'pelas',
'pelo',
'pelos',
'pequena',
'pequenas',
'pequeno',
'pequenos',
'per',
'perante',
'perto',
'pode',
'pude',
'pôde',
'podem',
'podendo',
'poder',
'poderia',
'poderiam',
'podia',
'podiam',
'põe',
'põem',
'pois',
'ponto',
'pontos',
'por',
'porém',
'porque',
'porquê',
'posição',
'possível',
'possivelmente',
'posso',
'pouca',
'poucas',
'pouco',
'poucos',
'primeira',
'primeiras',
'primeiro',
'primeiros',
'própria',
'próprias',
'próprio',
'próprios',
'próxima',
'próximas',
'próximo',
'próximos',
'pude',
'puderam',
'quais',
'quáis',
'qual',
'quando',
'quanto',
'quantos',
'quarta',
'quarto',
'quatro',
'que',
'quê',
'quem',
'quer',
'quereis',
'querem',
'queremas',
'queres',
'quero',
'questão',
'quinta',
'quinto',
'quinze',
'relação',
'sabe',
'sabem',
'são',
'se',
'segunda',
'segundo',
'sei',
'seis',
'seja',
'sejam',
'sejamos',
'sem',
'sempre',
'sendo',
'ser',
'será',
'serão',
'serei',
'seremos',
'seria',
'seriam',
'seríamos',
'sete',
'sétima',
'sétimo',
'seu',
'seus',
'sexta',
'sexto',
'si',
'sido',
'sim',
'sistema',
'só',
'sob',
'sobre',
'sois',
'somos',
'sou',
'sua',
'suas',
'tal',
'talvez',
'também',
'tampouco',
'tanta',
'tantas',
'tanto',
'tão',
'tarde',
'te',
'tem',
'tém',
'têm',
'temos',
'tendes',
'tendo',
'tenha',
'tenham',
'tenhamos',
'tenho',
'tens',
'ter',
'terá',
'terão',
'terceira',
'terceiro',
'terei',
'teremos',
'teria',
'teriam',
'teríamos',
'teu',
'teus',
'teve',
'ti',
'tido',
'tinha',
'tinham',
'tínhamos',
'tive',
'tivemos',
'tiver',
'tivera',
'tiveram',
'tivéramos',
'tiverem',
'tivermos',
'tivesse',
'tivessem',
'tivéssemos',
'tiveste',
'tivestes',
'toda',
'todas',
'todavia',
'todo',
'todos',
'trabalho',
'três',
'treze',
'tu',
'tua',
'tuas',
'tudo',
'última',
'últimas',
'último',
'últimos',
'um',
'uma',
'umas',
'uns',
'vai',
'vais',
'vão',
'vários',
'vem',
'vêm',
'vendo',
'vens',
'ver',
'vez',
'vezes',
'viagem',
'vindo',
'vinte',
'vir',
'você',
'vocês',
'vos',
'vós',
'vossa',
'vossas',
'vosso',
'vossos',
'zero',
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '_'
'a', 'ainda', 'alem', 'ambas', 'ambos', 'antes', 'ao', 'aonde', 'aos',
'apos', 'aquele', 'aqueles', 'as', 'assim', 'com', 'como', 'contra',
'contudo', 'cuja', 'cujas', 'cujo', 'cujos', 'da', 'das', 'de', 'dela',
'dele', 'deles', 'demais', 'depois', 'desde', 'desta', 'deste', 'dispoe',
'dispoem', 'diversa', 'diversas', 'diversos', 'do', 'dos', 'durante', 'e',
'ela', 'elas', 'ele', 'eles', 'em', 'entao', 'entre', 'essa', 'essas',
'esse', 'esses', 'esta', 'estas', 'este', 'estes', 'ha', 'isso', 'isto',
'logo', 'mais', 'mas', 'mediante', 'menos', 'mesma', 'mesmas', 'mesmo',
'mesmos', 'na', 'nao', 'nas', 'nem', 'nesse', 'neste', 'nos', 'o', 'os',
'ou', 'outra', 'outras', 'outro', 'outros', 'pelas', 'pelo', 'pelos',
'perante', 'pois', 'por', 'porque', 'portanto', 'propios', 'proprio',
'quais', 'qual', 'qualquer', 'quando', 'quanto', 'que', 'quem', 'quer', 'se',
'seja', 'sem', 'sendo', 'seu', 'seus', 'sob', 'sobre', 'sua', 'suas', 'tal',
'tambem', 'teu', 'teus', 'toda', 'todas', 'todo', 'todos', 'tua', 'tuas',
'tudo', 'um', 'uma', 'umas', 'uns'
]

@@ -603,0 +20,0 @@

{
"name": "stopword",
"version": "0.3.5",
"description": "A module for node.js and the browser that takes in text and returns text that is stripped of stopwords. Has pre-defined stopword lists for 32 languages and also takes lists with custom stopwords as input.",
"version": "1.0.0",
"description": "A module for node.js and the browser that takes in text and returns text that is stripped of stopwords. Has pre-defined stopword lists for 54 languages and also takes lists with custom stopwords as input.",
"main": "lib/stopword.js",

@@ -6,0 +6,0 @@ "scripts": {

# stopword
`stopword` is a module for node and the browser that allows you to strip stopwords from an
input text. [In natural language processing, "Stopwords" are words
that are so frequent that they can safely be removed from a text
without altering its
meaning.](https://en.wikipedia.org/wiki/Stop_words)
`stopword` is a module for node and the browser that allows you to strip
stopwords from an input text. [In natural language processing, "Stopwords" are
words that are so frequent that they can safely be removed from a text without
altering its meaning.](https://en.wikipedia.org/wiki/Stop_words)

@@ -83,23 +82,39 @@ [![NPM version][npm-version-image]][npm-url]

Arrays of stopwords for the following 32 languages are supplied:
Arrays of stopwords for the following 54 languages are supplied:
* `af` - Afrikaans
* `ar` - Modern Standard Arabic
* `bg` - Bulgarian
* `bn` - Bengali
* `br` - Brazilian Portuguese
* `br` - Breton
* `ca` - Catalan
* `cs` - Czech
* `da` - Danish
* `de` - German
* `el` - Greek
* `en` - English
* `eo` - Esperanto
* `es` - Spanish
* `et` - Estonian
* `eu` - Basque
* `fa` - Farsi
* `fi` - Finnish
* `fr` - French
* `ga` - Irish
* `gl` - Galician
* `ha` - Hausa
* `he` - Hebrew
* `hi` - Hindi
* `hr` - Croatian
* `hu` - Hungarian
* `hy` - Armenian
* `id` - Indonesian
* `it` - Italian
* `ja` - Japanese
* `ko` - Korean
* `la` - Latin
* `lgg` - Lugbara (without diacritics)
* `lggo` - Lugbara official (with diacritics)
* `lv` - Latvian
* `mr` - Marathi
* `nl` - Dutch

@@ -109,4 +124,8 @@ * `no` - Norwegian

* `pt` - Portuguese
* `ptbr` - Brazilian Portuguese
* `pa` - Punjabi Gurmukhi
* `ro` - Romanian
* `ru` - Russian
* `sk` - Slovak
* `sk` - Slovenian
* `so` - Somali

@@ -116,2 +135,4 @@ * `st` - Sotho

* `sw` - Swahili
* `th` - Thai
* `tr` - Turkish
* `vi` - Vietnamese

@@ -129,3 +150,3 @@ * `yo` - Yoruba

#### Languages with no space between words
`ja` Japanese and `zh` Chinese Simplified and some of the other languages supported have no space between words. For these languages you need to split the text into an array of words in another way than just `textString.split(' ')`. You can check out [TinySegmenter](http://chasen.org/%7Etaku/software/TinySegmenter/) for Japanese and [chinese-tokenizer](https://github.com/yishn/chinese-tokenizer) for Chinese.
`ja` Japanese, `th` Thai and `zh` Chinese Simplified and some of the other languages supported have no space between words. For these languages you need to split the text into an array of words in another way than just `textString.split(' ')`. You can check out [TinySegmenter](http://chasen.org/%7Etaku/software/TinySegmenter/) for Japanese and [chinese-tokenizer](https://github.com/yishn/chinese-tokenizer) for Chinese.

@@ -132,0 +153,0 @@ ## Your language missing?

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc