Hi All, good morning.
Considering I have a string "WEIGHTMANAGEMENT", is it possible in SAS to extract the words "Weight", "Manage" and "Management" without me specifying what to search but SAS producing all the possible words in a string?
Thanks and Regards,
Rama
Ram,
It is difficult to look for meaningful words in a string by SAS programming. Perhaps a built-in dictionary might be useful. However, I wonder whether you can rephrase your requirement such that you give some N number of predefined words and look for the occurrence any such word(s) within the String. You may ask for the number of words found in each of the Strings.
regards,
DataSp
So you also want:
we
man
manage
a
an
nag
age
gem
men
???
Yes, but I can restrict the number of characters per word then isn't it?
Look very closely at your list of "words" that you need to extract. This may be possible but order of processing may be important such as If I find "management" do I continue to look for "manage".
The more similar words you want to find the more complicated something like this gets. For instance if you also have to search for "MAN" or "EIGHT".
Do you know the words you want to search for or are you hoping to find a generic English (or other) language parser that could decipher:
"THISISASENTENCEWITHOUTANYSPACES". A native English speaker can probably decipher that phrase but I really would hate to try to program something to do that.
You might provide a larger number of examples and search words to work with, and to show the desired output.
Note that if want this to work with misspellings such as "WEIGHTMANAGEMNET" that is going to make this likely an order of magnitude more complicated.
SAS does have tools for more complex text processing in the SAS Text Miner module.
Google does it:
@PGStats wrote:
Google does it:
And how much time and $ was spent by Google to accomplish this.
I won't mention how many times Google tries to split my actual search terms incorrectly though.
Ram,
It is difficult to look for meaningful words in a string by SAS programming. Perhaps a built-in dictionary might be useful. However, I wonder whether you can rephrase your requirement such that you give some N number of predefined words and look for the occurrence any such word(s) within the String. You may ask for the number of words found in each of the Strings.
regards,
DataSp
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: