stringi (version 0.2-3)

stri_extract_words: Extract Words from a Text

Description

This function extracts all words from each string.

Usage

stri_extract_words(str, locale = NULL)

Arguments

str
character vector or an object coercible to
locale
NULL or "" for text boundary analysis following the conventions of the default locale, or a single string with locale identifier, see stringi-locale.

Value

  • A list of character vectors is returned. Each string consists of a separate word. If there are no words or if a string is missing, a single NA is provided on output.

Details

Vectorized over str.

Just like in stri_locate_words, ICU's word BreakIterator iterator is used to locate word boundaries, and all non-word characters (UBRK_WORD_NONE rule status) are ignored.

References

Boundary Analysis -- ICU User Guide, http://userguide.icu-project.org/boundaryanalysis

See Also

Other locale_sensitive: %!==%, %!=%, %<=%< a="">, %<%< a="">, %===%, %==%, %>=%, %>%, %stri!==%, %stri!=%, %stri<=%< a="">, %stri<%< a="">, %stri===%, %stri==%, %stri>=%, %stri>%; stri_cmp, stri_cmp_eq, stri_cmp_equiv, stri_cmp_ge, stri_cmp_gt, stri_cmp_le, stri_cmp_lt, stri_cmp_neq, stri_cmp_nequiv, stri_compare; stri_count_coll; stri_detect_coll; stri_duplicated, stri_duplicated_any; stri_enc_detect2; stri_extract_all_coll, stri_extract_first_coll, stri_extract_first_coll, stri_extract_last_coll, stri_extract_last_coll; stri_locate_all_coll, stri_locate_first_coll, stri_locate_first_coll, stri_locate_last_coll, stri_locate_last_coll; stri_locate_boundaries; stri_locate_words; stri_opts_collator; stri_order, stri_sort; stri_replace_all_coll, stri_replace_first_coll, stri_replace_first_coll, stri_replace_last_coll, stri_replace_last_coll; stri_split_boundaries; stri_split_coll; stri_trans_tolower, stri_trans_totitle, stri_trans_toupper; stri_unique; stri_wrap; stringi-locale; stringi-search-coll

Other search_extract: stri_extract_all_charclass, stri_extract_first_charclass, stri_extract_first_charclass, stri_extract_last_charclass, stri_extract_last_charclass; stri_extract_all_coll, stri_extract_first_coll, stri_extract_first_coll, stri_extract_last_coll, stri_extract_last_coll; stri_extract_all_regex, stri_extract_first_regex, stri_extract_first_regex, stri_extract_last_regex, stri_extract_last_regex; stri_extract_all; stri_extract_first; stri_extract_last; stri_extract; stringi-search

Other text_boundaries: stri_locate_boundaries; stri_locate_words; stri_split_boundaries; stri_wrap

Examples

Run this code
stri_extract_words("stringi: THE string processing package 123.48...")

Run the code above in your browser using DataCamp Workspace