VerifyInterpretation

VerifyInterpretation

is an option for TextCases, TextPosition and TextContents that verifies that results can be interpreted using Interpreter and related functions and drops those that cannot.

Details

  • When VerifyInterpretationTrue, only substrings that have an interpretation will be returned.

Examples

Basic Examples  (1)

Find all the occurrences of cities in a text:

In[1]:=
Click for copyable input
Out[1]=

Obtain the corresponding entities, which may result in some failures:

In[2]:=
Click for copyable input
Out[2]=

Get the entities directly from TextCases when they are available, and raw strings when the interpretation fails:

In[3]:=
Click for copyable input
Out[3]=

Use VerifyInterpretation to prune out the substrings that cannot be interpreted:

In[4]:=
Click for copyable input
Out[4]=
In[5]:=
Click for copyable input
Out[5]=
Introduced in 2019
(12.0)