mweiss Posted November 6, 2006 Posted November 6, 2006 My db consists of transcripts of interviews. For analytical purposes, I want to count how frequently certain words appear. The PatternCount function almost, but not quite, gets me what I want. The problem is this: Suppose I want to know how often the word "my" appears in a line of transcript. I can use PatternCount(Transcript::Text ; "my") But this results in a lot of "false positives", e.g. "academy" and "Jeremy". I could eliminate these by using the search string " my" (with a prepended space), but then I miss any time the word "my" appears at the beginning of the text. Surely there must be some way to do a pattern count for whole words, right? Or some well-known workaround?
Fitch Posted November 7, 2006 Posted November 7, 2006 Add a space before the text to search and that takes care of at least the problem you mentioned: PatternCount(" " & Transcript:: Text ; " my") You could also add a space to the end the same way. In addition you could enclose the first parameter in a Substitute function to turn all carriage returns, periods, commas etc. into spaces: PatternCount( Substitute( " " & Transcript:: Text & " " ; [",";" "] ; [".";" "] ; [etc.] ) ; " my ") If you're going to reuse the calc, you might consider making it a custom function.
Recommended Posts
This topic is 6653 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now