Example 4: Remove all Punctuation Marks and Delimiter at Punctuation - Analytics Database

Database Analytic Functions

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-11-06
dita:mapPath
gjn1627595495337.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
jmh1512506877710
Product Category
Teradata Vantageā„¢

Query Statement

SELECT * FROM TD_Ngramsplitter (
  ON text_data
  USING
  TextColumn ('text_data')
  Grams ('1-2')
  Punctuation('[[:punct:]]')
  Delimiter('[;,]')
  OutputTotalGramCount ('true')
) AS dt;

Output

id text_data city ngram n frequency totalcnt
5 Quetta, the fruit garden of Pakistan, is admired for its scenic beauty and mountainous landscapes. Quetta quetta 1 1 3
9 Peshawar&&& - Home to 1,000+ bazaars & many historic landmarks!!! Peshawar peshawar home to 1 1 1 2
7 Karachi$$$ - The city of 5 million lights & countless stars!! #Vibrant Karachi vibrant 1 1 2
6 Islamabad! 123 - A city with 20% greenery & 80% modern architecture!!! Islamabad islamabad 1 1 2
3 Lahore, the heart of Pakistan, is celebrated for its rich history and beautiful gardens. Lahore lahore 1 1 3
10 Quetta*** - Admired for its scenic beauty (50%) & mountainous (50%) landscapes. Quetta quetta admired for its scenic beauty 50 mountainous 50 landscapes 1 1 1
5 Quetta, the fruit garden of Pakistan, is admired for its scenic beauty and mountainous landscapes. Quetta the fruit garden of pakistan 1 1 3
9 Peshawar&&& - Home to 1,000+ bazaars & many historic landmarks!!! Peshawar 000 bazaars many historic 1 1 2
7 Karachi$$$ - The city of 5 million lights & countless stars!! #Vibrant Karachi karachi the city of 5 million lights countless stars 1 1 2
6 Islamabad! 123 - A city with 20% greenery & 80% modern architecture!!! Islamabad 123 a city with 20 greenery 80 modern architecture 1 1 2
3 Lahore, the heart of Pakistan, is celebrated for its rich history and beautiful gardens. Lahore the heart of pakistan 1 1 3
5 Quetta, the fruit garden of Pakistan, is admired for its scenic beauty and mountainous landscapes. Quetta is admired for its scenic beauty and mountainous landscapes 1 1 3
4 Peshawar, a city with a deep cultural heritage, is known for its ancient bazaars and historic landmarks. Peshawar peshawar 1 1 3
3 Lahore, the heart of Pakistan, is celebrated for its rich history and beautiful gardens. Lahore is celebrated for its rich history and beautiful gardens 1 1 3
1 Islamabad is known for its modern architecture and lush greenery. Islamabad islamabad is known for its modern architecture and lush greenery. 1 1 1
4 Peshawar, a city with a deep cultural heritage, is known for its ancient bazaars and historic landmarks. Peshawar city with a deep cultural heritage 1 1 3
8 Lahore@@@ - 2020: Heart of Pakistan, known for its 300+ years of history! Lahore known for its 300 years of 1 1 2
4 Peshawar, a city with a deep cultural heritage, is known for its ancient bazaars and historic landmarks. Peshawar is known for its ancient bazaars and historic landmarks 1 1 3
8 Lahore@@@ - 2020: Heart of Pakistan, known for its 300+ years of history! Lahore lahore 2020 heart of pakistan 1 1 2
2 Karachi, the city of lights, is famous for its vibrant culture and bustling streets. Karachi karachi 1 1 3
2 Karachi, the city of lights, is famous for its vibrant culture and bustling streets. Karachi the city of lights 1 1 3
2 Karachi, the city of lights, is famous for its vibrant culture and bustling streets. Karachi is famous for its vibrant culture and bustling streets 1 1 3