stopwords v0.9.0

0

Monthly downloads

0th

Percentile

Multilingual Stopword Lists

Provides multiple sources of stopwords, for use in text analysis and natural language processing.

Readme

stopwords: the R package

CRAN Version Travis-CI Build Status Coverage status Downloads Total Downloads

R package providing "one-stop shopping" for stopword lists in R, for multiple languages and sources. No longer should text analysis or NLP packages bake in their own stopword lists or functions, since this package can accomodate them all, and is easily extended.

Created by David Muhr, and extended in cooperation with Kenneth Benoit and Kohei Watanabe.

Installation

# from CRAN
install.packages("stopwords")

# Or get the development version from GitHub:
# install.packages("devtools")
devtools::install_github("davnn/stopwords")

Usage

head(stopwords::stopwords("de", source = "snowball"), 20)
##  [1] "aber"    "alle"    "allem"   "allen"   "aller"   "alles"   "als"    
##  [8] "also"    "am"      "an"      "ander"   "andere"  "anderem" "anderen"
## [15] "anderer" "anderes" "anderm"  "andern"  "anderr"  "anders"

head(stopwords::stopwords("de", source = "stopwords-iso"), 20)
##  [1] "a"           "ab"          "aber"        "ach"         "acht"       
##  [6] "achte"       "achten"      "achter"      "achtes"      "ag"         
## [11] "alle"        "allein"      "allem"       "allen"       "aller"      
## [16] "allerdings"  "alles"       "allgemeinen" "als"         "also"

For compability with the former quanteda::stopwords():

head(stopwords::stopwords("german"), 20)
##  [1] "aber"    "alle"    "allem"   "allen"   "aller"   "alles"   "als"    
##  [8] "also"    "am"      "an"      "ander"   "andere"  "anderem" "anderen"
## [15] "anderer" "anderes" "anderm"  "andern"  "anderr"  "anders"

Explore sources and languages:

# list all sources
stopwords::stopwords_getsources()
## [1] "snowball"      "stopwords-iso" "misc"          "smart"

# list languages for a specific source
stopwords::stopwords_getlanguages("snowball")
##  [1] "da" "de" "en" "es" "fi" "fr" "hu" "ir" "it" "nl" "no" "pt" "ro" "ru"
## [15] "sv"

Languages available

The following coverage of languages is currently available, by source. Note that the inclusiveness of the stopword lists will vary by source, and the number of languages covered by a stopword list does not necessarily mean that the source is better than one with more limited coverage. (There may be meany reasons to prefer the default "snowball" source over the "stopwords-iso" source, for instance.)

The following languages are currently available:

Language ISO-639-1 Code stopwords-iso snowball SMART misc
Afrikaans af
Arabic ar
Armenian hy
Basque eu
Bengali bn
Breton br
Bulgarian bg
Catalan ca
Chinese zh
Croatian hr
Czech cs
Danish da
Dutch nl
English en
Esperanto eo
Estonian et
Finnish fi
French fr
Galician gl
German de
Greek el
Hausa ha
Hebrew he
Hindi hi
Hungarian hu
Indonesian id
Irish ga
Italian it
Japanese ja
Korean ko
Kurdish ku
Latin la
Lithuanian lt
Latvian lv
Malay ms
Marathi mr
Norwegian no
Persian fa
Polish pl
Portuguese pt
Romanian ro
Russian ru
Slovak sk
Slovenian sl
Somali so
Southern Sotho st
Spanish es
Swahili sw
Swedish sv
Thai th
Tagalog tl
Turkish tr
Ukrainian uk
Urdu ur
Vietnamese vi
Yoruba yo
Zulu zu

Contributing

Additional sources can be defined and contributed by adding new data objects, as follows:

  1. Data object. Create a named list of characters, in UTF-8 format, consisting of the stopwords for each language. The ISO-639-1 language code will form the name of the list element, and the values of each element will be the character vector of stopwords for literal matches. The data object should follow the package naming convention, and be called data_stopwords_newsource, where newsource is replaced by the name of the new source.

  2. Documentation. The new source should be clearly documented, especially the source from which was taken.

License

This package as well as the source repositories are licensed under MIT.

Functions in stopwords

Name Description
stopwords_getlanguages list available stopwords country codes
data_stopwords_snowball snowball stopword list
data_stopwords_stopwordsiso multilingual stopwords from https://github.com/stopwords-iso/stopwords-iso
stopwords-package stopwords: one-stop shopping for stopwords in R
stopwords_getsources list available stopwords sources
lookup_iso_639_1 return ISO-639-1 code for a given language name
data_stopwords_misc miscellaneous stopword lists
data_stopwords_smart stopword lists from the SMART system
stopwords_options set package options for stopwords
stopwords Collection of stopwords in multiple languages
No Results!

Last month downloads

Details

Type Package
License MIT + file LICENSE
URL https://github.com/davnn/stopwords
BugReports https://github.com/davnn/stopwords/issues
Encoding UTF-8
LazyData true
RoxygenNote 6.0.1
NeedsCompilation no
Packaged 2017-12-14 11:34:57 UTC; rstudio
Repository CRAN
Date/Publication 2017-12-14 14:16:27 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/stopwords)](http://www.rdocumentation.org/packages/stopwords)