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`
ToLexicalPattern
​
ToLexicalPattern
[s]
converts string
s
to a lexical pattern.
​
​
ToLexicalPattern
[s,pos]
preserves tokens in string
s
at positions
pos
​
Details and Options

Examples  
(3)
Basic Examples  
(1)
Search text for similar phrases
In[1]:=
oosp=ExampleData[{"Text","OriginOfSpecies"}];
In[2]:=
lp=
ToLexicalPattern
["species developed poorly"]
Out[2]=
TypeToken[Noun]~~ ~~TypeToken[Verb]~~ ~~TypeToken[Adverb]
In[3]:=
LexicalCases
[oosp,lp]["CountGroups"]
Out[3]=
Matches
CountGroup
{selection will always}
7
{will be much}
5
{selection acts solely}
4
{
…
10
}
3
{
…
47
}
2
{
…
1228
}
1
Scope  
(2)

SeeAlso
LexicalPattern
 
▪
LexicalCases
 
▪
TypeToken
TechNotes
▪
LexicalCases Tutorial
RelatedGuides
▪
LexicalCases
RelatedLinks
▪
LexicalCases Github Repository
""

© 2025 Wolfram. All rights reserved.

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