9.7 Split string into a sequence of words
Split a string and generate a sequence of words.
In an article, find words whose numbers of appearances rank in top 3. Below is part of the
article content:
How to Call an SPL Script in Java
esProc provides its own JDBC driver to become integration-friendly with a Java application. The method of calling an esProc SPL script is similar to the execution of SQL queries and stored procedures in Java.
Deploying esProc JDBC in a Java application
Simply put, to deploy JDBC in a Java application is to put in place the necessary jars and configuration files for loading esProc when starting the application. esProc JDBC requires JDK 1.6 or a higher version.
…
SPL offers A.words() to split away English words in a string.
SPL script:
A | |
---|---|
1 | =file(“callSPL.txt”).read() |
2 | =A1.words() |
3 | =A2.group() |
4 | =A3.ptop(-3;~.len()) |
5 | =A3(A4).(~(1)).concat@c() |
A1 Read strings from the file.
A2 Use A.words() function to split away English words from strings.
A3 Group words in A2.
A4 Find words whose numbers of appearances rank in top 3.
A5 Concatenate desired words into a string with the comma.
Execution result:
Value |
---|
the,property,name |
SPL Official Website 👉 https://www.scudata.com
SPL Feedback and Help 👉 https://www.reddit.com/r/esProc_SPL
SPL Learning Material 👉 https://c.scudata.com
SPL Source Code and Package 👉 https://github.com/SPLWare/esProc
Discord 👉 https://discord.gg/cFTcUNs7
Youtube 👉 https://www.youtube.com/@esProc_SPL