I have a long dictionary-like string that I want to segment and store. It is in the format:
WORDA (n.) Definition. WORDB (n.) Definition.
I want to store the data in a list of the form:
{{"WORDA","n.","Definition."},{"WORDB","n.","Definition."}}
Is there any (simple) way to do this WITHOUT using regular expressions?
-Jesse
I think showing a working reasonably sized actual string (just a few word defenitions) would help to figure this out. I guess your “Definition” is quite a few words and the whole string is quotation marks or stored in a file originally?
s=" WORDA (n.) Definition. WORDB (n.) Definition. "; Partition[#,3]&@Flatten[Import[StringToStream@s,"Lines"]/.w_String:>StringSplit[w]]