Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

LexicalCases

Guides

  • LexicalCases

Tech Notes

  • LexicalCases Overview

Symbols

  • BoundToken
  • CountSummaryLowercase
  • DataJoin
  • ExpandPattern
  • FormatLexicalPattern
  • HideMissing
  • LexicalCases
  • LexicalDispersionPlot
  • LexicalDispersionSmoothHistogram
  • LexicalMap
  • LexicalPattern
  • LexicalPatternQ
  • LexicalStructure
  • LexicalSummary
  • LexigramCount
  • MaxCategories
  • OptionalToken
  • Sandwich
  • StopWordQ
  • SynonymToken
  • TextType
  • ToLexicalPattern
  • TypeToken
  • WordToken
  • $FilterableProperties
  • $LexicalCasesServices
  • $SampleParagraph
  • $SampleSentence
  • $SampleStringExpression
FaizonZaman`LexicalCases`
WordToken
​
WordToken
[n]
represents n words separated by spaces
​
​
WordToken
[n,m]
represents
n
to
m
words separated by spaces
​
​
WordToken
[spec,"KeepContractions"]
considers contractions as single words
​
Details and Options

Examples  
(4)
Basic Examples  
(1)
Find contexts of "the" in a paragraph
In[1]:=
$SampleParagraph
Out[1]=
The words hadn't flowed from his fingers for the past few weeks. He never imagined he'd find himself with writer's block, but here he sat with a blank screen in front of him. That blank screen taunting him day after day had started to play with his mind. He didn't understand why he couldn't even type a single word, just one to begin the process and build from there. And yet, he already knew that the eight hours he was prepared to sit in front of his computer today would end with the screen remaining blank.
In[2]:=
LexicalCases

$SampleParagraph
,
WordToken
[1]~~"the"~~
WordToken
[1]["Dataset"]
Out[2]=
Match
Position
for the past
42
53
begin the process
330
346
that the eight
395
408
with the screen
480
494
Scope  
(2)

Possible Issues  
(1)

SeeAlso
LexicalCases
 
▪
BoundToken
 
▪
OptionalToken
TechNotes
▪
LexicalCases Overview
RelatedGuides
▪
LexicalCases
RelatedLinks
▪
LexicalCases GitHub Repository
""

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com