Re: Lix count (readabillity) / Flesch-Kincaid



"achristoffersen" <achristoffersen@xxxxxxxxx> wrote in message
news:1130669597.140388.80510@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>A few more questions:
>
> Is it correct that I cannot use this code in a query? So I must make a
> form, and then call via a cmd - on event function?

You could create turn the snippet of code into a function that returns a
value, but since I don't understand how you calculate readability, it's
difficult to tell you what that value that's returned should be.

> What exactly is the syntax for the strfile... is it simply the path to
> the mdb file? Or just the tabel and field name?

The code I wrote assumed that strFile contained the actual text of a
paragraph you're analysing. If you were to turn that code into a function,
I'd assume that you'd pass strFile into the function as a parameter:

Function AnalysisText(TextToAnalyse As String) As ?

then you'd replace

varSentences = Split(strFile, ".")

with

varSentences = Split(TextToAnalyse, ".")


> Where is lngCountLongWords, lngCountWords, lngSentence and lngWords
> created? In the strfile? Not in a separate query?

Not quite sure what you mean by "created". Those four values are variables
used in the code. If you convert the code into a function, they'd be local
to the function: not used (or accessible) anywhere else.

lngSentence and lngWord (that was a typo in the original code: I use
lngWord, not lngWords everywhere else) are simply looping variables. The
first Split function takes the paragraph that's supplied, and creates an
array out it, with each element in the array representing a different
sentence in the paragraph. lngSentence is how the code loops through each
sentence. Similarly, the second Split function takes each sentence, and
creates an array of each word in the sentence, and lngWord loops through
each word.

lngCountWords and lngCountLongWords are the gist of the function: when all
of the loops are done, lngCountWords contains how many words are in the
paragraph, while lngCountLongWords contains how many of those words are
greater than the given length (9 letters in my sample code)

If you need more help, you're going to have to provide details such as how
your data is stored in the database, and what calculation needs to be done
once you've determined how many words and how many "long words" are in the
snippet of text being analysed.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)





.