TextWords
Details

- Characters in string that are not identified as being part of words are dropped by TextWords.
- TextWords[ContentObject[…]] gives words from the plain text contents of the ContentObject.
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Segment a string into a list of words:

https://wolfram.com/xid/0cg4efaic-lrlrk0


https://wolfram.com/xid/0cg4efaic-g8ugv2

TextWords separates words by punctuation as well as whitespace:

https://wolfram.com/xid/0cg4efaic-54wi3r


https://wolfram.com/xid/0cg4efaic-xe5kog

Get the first 10 words in a block of text:

https://wolfram.com/xid/0cg4efaic-kzsd2t


https://wolfram.com/xid/0cg4efaic-dzpklh

Scope (3)Survey of the scope of standard use cases
TextWords preserves hyphenation:

https://wolfram.com/xid/0cg4efaic-frgykc


https://wolfram.com/xid/0cg4efaic-624a3k

Titles, currencies and other syntactic units are segmented as separate words:

https://wolfram.com/xid/0cg4efaic-7phkzv


https://wolfram.com/xid/0cg4efaic-jvc64b


https://wolfram.com/xid/0cg4efaic-jmshtq

Get a list of words from a ContentObject:

https://wolfram.com/xid/0cg4efaic-jqnw9i


https://wolfram.com/xid/0cg4efaic-ep0rb7

Applications (1)Sample problems that can be solved with this function
Properties & Relations (2)Properties of the function, and connections to other functions
TextWords is equivalent to TextCases[…,"Word"]:

https://wolfram.com/xid/0cg4efaic-ftayor


https://wolfram.com/xid/0cg4efaic-kr3x0l

TextStructure splits texts into the same words:

https://wolfram.com/xid/0cg4efaic-x2sjvp


https://wolfram.com/xid/0cg4efaic-baxsvs

Possible Issues (1)Common pitfalls and unexpected behavior
Words returned by TextWords are identified structurally, and may not be dictionary words:

https://wolfram.com/xid/0cg4efaic-lljvav


https://wolfram.com/xid/0cg4efaic-hnnm2n

Wolfram Research (2015), TextWords, Wolfram Language function, https://reference.wolfram.com/language/ref/TextWords.html (updated 2016).
Text
Wolfram Research (2015), TextWords, Wolfram Language function, https://reference.wolfram.com/language/ref/TextWords.html (updated 2016).
Wolfram Research (2015), TextWords, Wolfram Language function, https://reference.wolfram.com/language/ref/TextWords.html (updated 2016).
CMS
Wolfram Language. 2015. "TextWords." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/TextWords.html.
Wolfram Language. 2015. "TextWords." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/TextWords.html.
APA
Wolfram Language. (2015). TextWords. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TextWords.html
Wolfram Language. (2015). TextWords. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TextWords.html
BibTeX
@misc{reference.wolfram_2025_textwords, author="Wolfram Research", title="{TextWords}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/TextWords.html}", note=[Accessed: 08-July-2025
]}
BibLaTeX
@online{reference.wolfram_2025_textwords, organization={Wolfram Research}, title={TextWords}, year={2016}, url={https://reference.wolfram.com/language/ref/TextWords.html}, note=[Accessed: 08-July-2025
]}